Grouping Components

JDeveloper provides a number of container components for grouping components together so they behave as a single component at design time.

For instance, you might group a row of buttons in a Panel to create a toolbar. Or you could use a container component to create a customized backdrop, status bar, or checkbox group.

When you place components within containers, you create a relationship between the container and the components it contains. Design time operations you perform on the containers, such as moving, copying, or deleting, also affect any components grouped within them.

To group components by placing them into a container:

  1. Add a container to the UI.

    If you are working in a layout that considers size such as the GridBagLayout, null layout or XYLayout, you can drag to size it.

  2. Add each component to the container, making sure the mouse pointer falls within the container's boundaries. (The status bar at the bottom of JDeveloper displays which container your mouse is over.) You can add a new component from the Component Palette, or drag an existing component into the new container.

    As you add components, they appear inside the selected container in the Java Visual Editor, and under that container in the Structure window.

Tip: If you want the components to stay where you put them, change the container's layout to null before adding any components. Otherwise, the size and position of the components will change according to the layout manager used by the container. You can change to a final layout after you finish adding the components.


About Containers
Working with Layout Managers