You arrange all the labels, text fields,
and buttons in a panel using an instance of the
GridLayout
layout manager. The GridLayout
constructor takes four arguments:
the number of rows, the number of columns, the spacing between rows, and
the spacing between columns.
To specify that you want three rows and four columns, with reasonable spacing, you specify the following layout manager:
setLayout(new GridLayout (3, 4, 3, 3));