Basic HTML version of Foils prepared June 5 99

Foil 58 Layout Managers

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. by Geoffrey C. Fox


The various panels in a container are laid out separately in terms of their subcomponents
The arrangement is controlled by general strategies which are embodied in 5 LayoutMangers
To create a layout, such as FlowLayout, in your panel:
  • setLayout(new FlowLayout());
  • This particular Layout is the default and flows in the components in the order that the add method is called.
Other Layout Managers:
  • GridLayout - a regular rectangular grid (table)
  • BorderLayout - 5 areas as in diagram
  • GridBagLayout - general arrangement of space
  • CardLayout - card panels replace each other in the same space.



© 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 Sat Jun 5 1999