GridLayout creates a rectangular grid upon which components are placed. E.g., setLayout(new GridLayout(3, 2)); sets the grid to 3 rows and 2 columns. If four parameters are present, the third parameter is horizontal spacing and the fourth is vertical spacing.