GUI Builder Tasks: Quick Reference

See Also

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-Shift-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.
  1. In the Palette window, click a JMenuBar (icon for JMenuBar) or MenuBar (icon for MenuBar) component.
  2. 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.
  1. Right-click the menu bar in the Inspector window and choose Add JMenu or Add Menu from the contextual menu.
  2. 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.
  1. In the Inspector window, right-click the menu to which you would like to add an item.
  2. Choose Add from the contextual menu and then choose an item from the submenu.
  3. 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.
  1. In the Palette window, click the JPopupMenu (icon for JPopupMenu) or PopupMenu (icon for PopupMenu) contextual menu component.
  2. 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.
  1. Choose Tools > Options.
  2. Select the GUI Builder Settings node.
  3. Edit the desired GUI Builder properties.
Move or copy a component.
  1. Select the component in the GUI Builder or Inspector window.
  2. Right-click the component and choose Cut or Copy from the contextual menu.
  3. 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.
  1. 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.
  2. Type the new label and press Enter.
Create a Palette window category.
  1. Choose Tools > Palette > Swing/AWT Components.
  2. Click the New Category button.
  3. Type a name for the new category in the dialog box that appears and click OK.
Remove a Palette window category.
  1. Choose Tools > Palette > Swing/AWT Components.
  2. Click the Remove button.
  3. Click Yes in the dialog box that appears.
Copy a palette category item.
  1. Choose Tools > Palette > Swing/AWT Components.
  2. In the Palette, right-click any existing component and choose Copy from the contextual menu.
  3. Right-click the Palette category in which you wish to place the component and choose Paste > Copy.
Remove a palette category item.
  1. Choose Tools > Palette > Swing/AWT Components.
  2. Click the Remove button.
  3. Click Yes in the dialog box that appears.
Add a bean to the Palette window.
  1. Choose Tools > Palette > Swing/AWT Components.
  2. If you wish to create a new category for the bean, click New Category before you add the bean.
  3. Click Add from JAR, Add from Library, or Add from Project. Complete the wizard to add the bean.
See Also
About Java GUIs
Working with the GUI Builder
Designing Java GUIs with the GUI Builder

Legal Notices