Using GridLayout (AWT)

You can use the visual editor for Java to lay out Swing components using GridLayout.

The layout manager java.awt.GridLayout lays out components in a grid of equal-sized rectangles in rows and columns. You can set the number of rows or columns that a GridLayout will contain. As you add components, they are added in order based on the componentOrientation property of the container that is using GridLayout (RIGHT_TO_LEFT or LEFT_TO_RIGHT).

Buttons in a GridLayout

Related concepts
Layout managers and containers

(C) Copyright IBM Corporation 1999, 2004. All Rights Reserved.