Basic HTML version of Foils prepared March 26 1999

Foil 10 GridLayout

From Java Academy:Graphical User Interface NPAC Java Academy February--April 99 -- March 1999. by Nancy McCracken


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.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Fri Mar 26 1999