Containers are created with default layout managers. Most use BorderLayout by default. Panels use FlowLayout by default.
Layout managers do not apply to all containers. For example, JScrollPane, JTabbedPane, JDesktopPane, and JSplitPane have their own special layouts that cannot be changed.
You can change the layout manager of most containers using the Component Palette, Form Designer, or Component Inspector.
To set the layout manager using the Component Palette:
If you are not yet familiar with the icons that represent the various layout managers, move the pointer over each image to see the tool tips.
Alternatively, if you have chosen the small palette, click the Add Mode (plus sign) button in the Component Palette, and choose a layout manager from menu that is displayed.
To set the layout manager using the Form Designer or Component Inspector:
![]() |
When you change layouts, the IDE remembers the properties of the discarded layout manager. If you change the layout manager back, the component looks the same as it previously looked with that layout manager. |
See also | |
---|---|
Component Palette
Setting Layout Properties Standard Layout Managers |