Basic HTML version of Foils prepared Sept 21 1998

Foil 46 Layout of Components in a Panel

From Java Tutorial 98- 3: Graphics and the Abstract Windowing Toolkit NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken


1 The various panels in a container are laid out separately in terms of their subcomponents
2 One can lay components out "by hand" with positioning in pixel space
3 However this is very difficult to make machine independent. Thus one tends to use general strategies which are embodied in 5 LayoutMangers which all implement the LayoutManager Interface. One can expect further custom LayoutManager's to become available on the Web
4 To create a layout, such as FlowLayout, in your panel:
  • setLayout(new FlowLayout());
  • This particular Layout is the default.

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 Nov 28 1998