GridLayouts
The first two arguments of the GridLayout constructor specify the number of rows of cells (i.e. number of cells in the y direction) and the number of columns of cells (in the x direction)
- setLayout(new GridLayout (2, 3));
Additional arguments hgap and vgap specify the number of pixels inbetween the columns and rows:
- setLayout(new GridLayout (2, 3, 10, 15 ));
The GridLayout Manager's strategy is to make each cell exactly the same size so that rows and columns line up in a regular grid.