Beanbox integration for JWidgets

Article ID: 811
Last updated: 05 Feb, 2008
Article ID: 811
Last updated: 05 Feb, 2008
Revision: 1
Views: 3077
Posted: 18 Jul, 1997
by Dean J.
Updated: 05 Feb, 2008
by Dean J.
Problem


How do I integrate JWidgets into the Beanbox?


Cause





Action


To integrate the JWidgets Beans into the BDK 1.0 - June '97 Beanbox tool palette, copy the design-time JAR files into thejars directory in the BDK install directory.  The instructions below assume that you have installed the June BDK in c:dk and JWidgets into c:products.

copy c:productsjwidgets3_0jarsdesign*.* c:dkjars

The next time you run the Beanbox, the JWidgets beans appear in the Tool Palette, ready for use.

Usage Notes

The BDK 1.0 - June '97 release does not allow a JavaBeans component to be sized differently than its preferred size.  The majority of the JWidgets JavaBeans return a preferred size that is based on their current configuration.  You can modify the BDK source code to eliminate this problem.  The instructions for this small change are listed below:
 
1) Open the c:\bdk\beanbox\sun\beanbox\Wrapper.java file in your favorite source code editor.
2) Change one line in the sizeToFit() method as shown below:
Original method
private void sizeToFit() {
  if (childHasStupidPreferredSize()) {
    return;
  }
  Dimension d = getPreferredSize();
  setSize(d.width, d.height);
}
Updated method
private void sizeToFit() {
  if (childHasStupidPreferredSize()) {
    return;
  }
  Dimension d = getSize();
  setSize(d.width, d.height);
}
Rebuild the Beanbox by typing nmake (Win32) or make (Solaris) in the BDK install directory.
cd c:\bdk
nmake

That's it!  You can now design your Java applet or application using the JWidgets JavaBeans components.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 811
Last updated: 05 Feb, 2008
Revision: 1
Views: 3077
Posted: 18 Jul, 1997 by Dean J.
Updated: 05 Feb, 2008 by Dean J.

Others in this category