Adding a Component to a Form
See Also
Once you have created a new form, you can add components which provide the
desired display information and control functionality. In the IDE, you can
add components several ways, including:
- Drag and Drop
- Pick and Plop
- The Inspector window.
To add a component from the Palette:
- Select a component in the Palette window by clicking its icon. Without releasing
the mouse button, drag the component to the desired location in the form.
- If you want to add the component to the Other Components node, drag the component
to the white area outside the form in the GUI Editor's workspace.
The IDE adds the component to the selected container in the form.
To add multiple components from the Palette:
- Select the component you want to add in the Palette window by clicking its icon.
- While holding down the Shift key, click the location in the form where
you want to place the first component.
- Click each additional location in the form that you want to place an
instance of the component you selected in the Palette.
- If you want to add the component to the Other Components node, click in
the white area outside the form in the GUI Editor's workspace.
The IDE adds the components to the selected container in the form.
To add a component using the Inspector window:
- In the Inspector window, right-click the container to which you want to add a
component.
- Choose the desired component from the Add From Palette submenu.
The IDE adds the component to the selected container in the form.
To add a bean from the Projects, Files, or Favorites windows:
- In the Files window, locate the bean's class node. The class must be a
bean and it must be compiled. Note that for a class to be a
bean, it must be possible to create an instance of the class using an empty
public constructor.
- Right-click the class node and choose Copy from the contextual menu.
- Choose Paste from the contextual menu of either the GUI Builder or the
Other Components node in the Inspector window.
The IDE adds the bean to the current form.
- When working with nested containers, it is sometimes
difficult to select the container to which you want to add the component.
You must first select the desired container before selecting the component
you want to add. You then select the component from the Palette window,
hold down the Alt key, and click the desired container again to add the
component.
- See Also
- Selecting Components in a Form
- Editing Component Properties
- Designing Java GUIs with the GUI Builder
- Adding a Bean to the Palette Window
Legal Notices