<<< FlowLayout methods | Index | GridLayout demo >>> |
Arranges components into equal rows and columns:
container.setLayout( new GridLayout( ROWS, COLUMNS ) );
Container surface becomes divided into grid
Another constructor allows to specify vertical and horizontal gaps between rows and columns in pixels:
container.setLayout( new GridLayout( ROWS, COLUMNS, GAP_PIXELS_ROW, GAP_PIXELS_COL ) );
Note: number of rows or columns can be zero. In that case the layout manager will determine the number of rows/columns automatically.
<<< FlowLayout methods | Index | GridLayout demo >>> |