HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 4 February 97

Foil 22 Hierarchical use of LayoutManagers

From Feb 3 Delivered Lecture for Course CPS616 -- Java Lecture 4 -- AWT Through I/O CPS616 spring 1997 -- Feb 3 1997. by Nancy McCracken * Critical Information in IMAGE
Secs 149.7
Layout's can be made very sophisticated using an hierarchical approach
setLayout(new GridLayout(1,3,10,5));
  • // Number of cells in y, Number in x, Horizontal gap, Vertical Gap
subpanel1 = new MysubpanelClass(); // Add arguments to make subpanel1 special
subpanel2 = new MysubpanelClass();
add(Some Simple Component such as a Button);
add(subpanel1);
add(subpanel2);
. . . . .
Class MysubpanelClass extends panel { // has constructor
MysubpanelClass() { // that includes another layout such as
setLayout(new GridLayout(2,2,5,5); // etc.


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 Feb 16 1997