Working with Containers

See Also

Java GUIs are forms comprised of top-level containers within which are grouped sub-containers as well as the various components used to provide the desired information and control functionality.

Controlling View Focus

It is often useful to focus work on single subcontainers rather than the entire form the GUI Builder generally displays. When working with large forms containing complex nested hierarchies of containers, changing the scope of the GUI Builder's focus enables you to concentrate on specific parts of your interface.

To change the GUI Builder's focus to a specific container:

  1. In the GUI Builder or Inspector window, right-click the container you want to edit.
  2. Choose Design This Container from the contextual menu.

    The IDE adjusts display of the workspace such that the current container fills the work area and hides the form's other components. The form's entire hierarchy remains available in the Inspector window.

To return the GUI Builder's display focus to the entire form:

  1. Right-click the container in the GUI Builder.
  2. Choose Design Top Container from the contextual menu.

    The IDE adjusts the work area display such that the entire form is visible. If the Design Top Container menu item is dimmed, you are already designing the entire form.

Reordering Components Within a Container

The order of components in a container follows the sequence in which components are added. If the layout manager you have chosen for a container does not use constraints (FlowLayout, BoxLayout, and GridLayout), the order of components also determines how they are arranged visually. You can, however, reorder the components using the Inspector window or by dragging them in the form itself.

See Also
Creating a New Form
Adding a Component to a Form
About Layout Managers

Legal Notices