A layout manager assists you in determining the size and position of the components within a container. Each container type has a default layout manager. BorderLayout is the default layout manager for the JFrame component. BorderLayout divides the container into five sections (north, south, east, west, and center). You will switch to GridLayout, which creates sections equal in size and displays them in the requested numbers of rows and columns.
To change layout managers:
The Layouts pane provides access to the layout managers in the Java Foundation Classes (JFC). When you move the pointer over a button in the toolbar, a tool tip displays the name of the layout manager.
The Form Editor changes to display a grid three columns wide by two rows deep.
The properties of this layout manager appear in the Properties pane of the Component Inspector.
The Form Editor now displays a grid with one column and two rows.
Next:![]() Back: ![]() |