The Toolbox provides a list of controls that are currently available. These controls can be Windows Foundation Classes for Java (WFC) controls, ActiveX controls, or HTML intrinsic controls. You can use them to design your forms and HTML pages. The Toolbox can also be used to store collections of controls that you copy from your form and source code and want to reuse in your current project or in other projects. The Toolbox provides tabs for grouping related controls. You can then use these tabs to navigate among the different types of controls and objects. Using the Toolbox makes finding and organizing your controls and objects easier.
By default, all WFC controls provided by Visual J++ are listed in the Toolbox. You can also add controls that you have created or purchased from a third party.
To add a control to the Toolbox
For example, if you want to add a WFC control that you created, click the WFC Controls tab (which is shown by default).
Note In order for a WFC control to be displayed in the Toolbox, it must extend com.ms.wfc.core.Component and have its ShowInToolbox attribute set to true.
While designing a user interface for a form, you may find that you want to reuse a group of controls and their property settings in a different form or in a different project. Use the Toolbox to store groups of controls to reuse later.
To copy controls from a form to the Toolbox
A new Toolbox item is added called "Form Fragment." You can rename the form fragment by right-clicking the item and clicking Rename.
After you have the group of controls in the Toolbox, you can add them to a form just as you would any other control.
In addition to copying controls to the Toolbox, you can also copy fragments of code. You can copy routines that you use frequently and apply them to other projects.
To copy source code fragments to the Toolbox
A new Toolbox item is added called "Text Fragment." You can rename the text fragment by right-clicking the item and clicking Rename.
Although Visual J++ provides a variety of tabs in the Toolbox, you can also create your own tabs. In addition, you can use tabs to group Toolbox items that are used in your project. For example, if your project uses ActiveX and WFC controls to build its user interface, you can create a tab and have all the controls that you use displayed as a group.
To add a tab to the Toolbox
You can now select the tab and add controls and objects to it.
After you have created a tab, you can then add Toolbox items to it and move items that are located on other tabs to your new tab. In addition to moving controls between tabs, you can also copy controls from one tab to another. You can then store the same controls in more than one group.
To move a Toolbox item between tabs
To copy a Toolbox item to another tab
After you have created a tab, you can change its caption.
To rename a tab in the Toolbox
By default, each Toolbox item is displayed with a symbol that represents the control. Although you can move the mouse over the control to display its name, you may want to see a list of item names. Use List View mode to view a list of controls.
To view Toolbox items as a list
This displays the contents of the active tab in the Toolbox in a list format.
To view the symbols, click List View again.
You can remove items from the Toolbox so that it is less cluttered. You can also remove copies of controls that you have placed on different tabs.
Note Deleting controls from the Toolbox does not remove the control from your form, and it can be added back to the Toolbox. For information, see "Adding a Control to the Toolbox" earlier in this topic.
To delete items from the Toolbox
The item is removed from the Toolbox.