A GridLayout divides the applet area into rows and columns of equal size. |
To get a GridLayout, use the setLayout method in the applet, and make a GridLayout with the number of rows and columns: setLayout ( new GridLayout ( 3, 2 ) ); |
Use the add method to add components in the same order as before, but now |
label |
label |
button |
textfield |
textfield |
they will line up, and they will be made the same size. |