GridLayout

This layout places components in a rectangular grid. There are three constructors:
GridLayout(): creates a layout with one column per component. Only one row is used.
GridLayout(int rows, int cols): creates a layout with the given number of rows and columns.
GridLayout(int rows, int cols, int hgap, int vgap): creates a layout with the given number of rows and columns, and the given size of horizontal and vertical gaps between each row and column.
GridLayout places components from left to right and from top to bottom assigning the same size to each. It forces occupation of all available space and shares it evenly between components. When not used carefully this can lead to undesirable component sizing, such as text boxes three times higher than expected.