Basic HTML version of Foils prepared May 12 1996

Foil 120 Layout of Components in a Panel

From CRPC Lectures on Java Language Applets Graphics CRPC Annual Meeting Tutorial -- May 14,1996. by Geoffrey C. Fox


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 LayoutManger's which all implement the LayoutManager Interface. One can expect further custom LayoutManager's to become available on the Web
4 setLayout(new FlowLayout()); // creates a basic flow layout in your panel -- actually unnecessary as default
5 Other available LayoutManager's are GridLayout(), BorderLayout() (default for Frame's), CardLayout() (Used for dynamic layouts) and GridBagLayout() (the most flexible)

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 Sun Dec 14 1997