VisualAge provides a wide range of beans that you can use to visually compose your own program elements. These include the following:
The following topics describe beans provided by IBM. When you create your own beans, you can add them to the palette. See the related task topic on modifying the palette.
VisualAge provides a set of user interface beans that you can use to compose an applet or application. Basic user interface beans from the Abstract Windowing Toolkit (AWT) are provided in the Java class libraries project. AWT beans are in the java.awt and java.applet packages. Enhanced user interface beans from the Java Foundation Classes (JFC) library are provided in the JFC class libraries project. Swing beans are in com.sun.java.swing and related packages.
Although Swing and AWT components can be mixed, it is inadvisable. For this reason, VisualAge does not allow you to drop AWT beans on Swing beans. Because you might want to add Swing beans to AWT beans that you created before Swing was available, VisualAge does allow you to drop Swing beans on AWT beans. You can morph the AWT beans to Swing beans when you are ready to convert completely to Swing.
The problem with mixing AWT and Swing beans arises from the fact that all AWT components have peer classes that are specific to the operating system, while most Swing components do not. Components with system peers are known as heavyweight components. Components without system peers are known as lightweight components. The only Swing heavyweight components are JApplet, JDialog, JFrame, and JWindow. Painting problems occur if heavyweight components are children of lightweight parents, because the heavyweight components always paint over lightweight components.
VisualAge provides its own BeanInfo classes for Swing and AWT beans. These BeanInfo classes are tailored for visual composition.
Swing beans have a LookAndFeel (L&F) architecture that specifies how Swing components appear and behave. On the Visual Composition Editor, Swing beans appear in the default, cross-platform Metal L&F implementation. To change the runtime appearance to the System L&F of the current platform, execute the following code in your main method before you construct your components:
String myLookAndFeel = com.sun.java.swing.UIManager.getSystemLookAndFeelClassName(); com.sun.java.swing.UIManager.setLookAndFeel(myLookAndFeel);
The myLookAndFeel can be the name of any class that implements com.sun.java.swing.LookAndFeel and is available on the current platform. This code changes only the runtime L&F implementation and not the images on the Visual Composition Editor.
VisualAge information about Swing and AWT beans supplements class information from JavaSoft. VisualAge reference topics for these beans provide links to JavaSoft class information. The following topics describe these beans:
VisualAge provides a set of data access beans that you can use for querying relational databases. The following topic describes these beans:
VisualAge provides Factory and Variable beans that you can use to dynamically create and reference bean instances. The following topic describes these beans:
How Classes and Beans Are Related
Using VisualAge Beans in Visual Composition
Managing the Beans Palette