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


1 The various panels in a container are laid out separately in terms of their subcomponents
2 The arrangement is controlled by general strategies which are embodied in 5 LayoutMangers
3 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.
4 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.

in Table To:


© 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