The following table describes common GUI Builder tasks.
To perform this task |
Follow these steps |
Reload a form. |
Do one of the following:
- Press Ctrl-R in either the GUI Builder or the Source Editor.
- Right-click the root node of the form in either the Files window,
Projects window, or Inspector window and select Reload Form from the
contextual menu.
|
Create a menu bar. |
- In the Palette window, click a JMenuBar (
)
or MenuBar ( )
component.
- Click anywhere in the JFrame, JDialog, or JApplet container
to which you want to add the menu bar.
If this is the first menu bar you have added to the form, the menu
bar appears visually on the form. If this is not the form's first
menu bar, the menu appears below the Other Components node in the
Inspector window and is not visible in the form.
|
Add a menu to a menu bar. |
- Right-click the menu bar in the Inspector window and choose Add
JMenu or Add Menu from the contextual menu.
- If you wish to name the new menu, expand the menu
bar node in the Inspector window, right-click the newly created menu
node, and choose Properties. Then enter the desired name for the text
property.
|
Add a menu item. |
- In the Inspector window, right-click the menu to which you would
like to add an item.
- Choose Add from the contextual menu and then choose an item from
the submenu.
- If you wish to rename the new menu item, expand the
menu node in the Inspector window, right-click the newly created menu
item, and choose Properties. Then enter the desired name for the text
property.
|
Create a contextual menu. |
- In the Palette window, click the JPopupMenu (
)
or PopupMenu ( )
contextual menu component.
- Click anywhere in the form to add the contextual menu. The new menu
appears under the Other Components list in the Inspector window.
|
Add an event handler to a component. |
Do one of the following:
- Select the component in the Inspector window. Then click the Events
button in the Properties window and select the desired event property.
- Right-click the component in the Inspector window or GUI Builder
and choose the desired event from the Events menu in the contextual
menu.
- Use the Connection wizard by clicking the connection icon in the
GUI Builder toolbar, next clicking the source component, and then
clicking the target component.
|
Configure the GUI Builder. |
- Choose Tools > Options.
- Select the GUI Builder Settings node.
- Edit the desired GUI Builder properties.
|
Move or copy a component. |
- Select the component in the GUI Builder or Inspector window.
- Right-click the component and choose
Cut or Copy from the contextual menu.
- Right-click the destination container in the GUI Builder or Inspector
window and choose Paste from its contextual menu. The component or
components are moved or copied with all properties intact. Events are
maintained only if you are pasting within the same form.
|
Edit component labels. |
- Select the component in the GUI Builder and do one of the following
to display the in-place editing field:
- Press the spacebar.
- Click the component again.
- Right-click the component and choose Edit Text from the contextual
menu.
- Type the new label and press Enter.
|
Create a Palette window category. |
- Choose Tools > Palette > Swing/AWT Components.
- In the Palette window, right-click any existing category button
and choose Create New Category from the contextual menu.
- Type a name for the new category in the dialog box that appears
and click OK.
|
Create a Palette window category. |
- Choose Tools > Palette > Swing/AWT Components.
- Click the New Category button.
- Type a name for the new category in the dialog box that appears
and click OK.
|
Remove a Palette window category. |
- Choose Tools > Palette > Swing/AWT Components.
- Click the Remove button.
- Click Yes in the dialog box that appears.
|
Copy a palette category item. |
- Choose Tools > Palette > Swing/AWT Components.
- In the Palette, right-click any existing component and choose
Copy from the contextual menu.
- Right-click the Palette category in which you wish to place the
component and choose Paste > Copy.
|
Remove a palette category item. |
- Choose Tools > Palette > Swing/AWT Components.
- Click the Remove button.
- Click Yes in the dialog box that appears.
|
Add a bean to the Palette window. |
- Choose Tools > Palette > Swing/AWT Components.
- If you wish to create a new category for the bean, click New Category
before you add the bean.
- Click Add from JAR, Add from Library, or Add from Project. Complete
the wizard to add the bean.
|