Specifying a layout manager

You can specify a layout manager for a container to help you manage the layout and organization of the visual components within that container.

Your Java class must contain a container, such as JFrame, JPanel, or Shell, that allows for a layout manager to be set.

When you add a container to a Java class in the visual editor, it is given a default layout manager or is set to null. For example, the default layout manager in the visual editor for JPanel is FlowLayout. You can change the layout by changing the layout property in the Properties view.

  1. In the Design view or Java Beans view, select the container that you want to specify a layout manager for.

  2. In the Properties view, locate the layout property, and click its value column.

  3. Select the layout manager that you want to use for the container.

 

Parent topic

Laying out components using the visual editor

 

Related concepts

Layout managers and containers
Swing and AWT layout managers
SWT layout managers