Specifications

Sun Services
Java™ Programming Language
Module 10, slide 34 of 37
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
The ComplexLayoutExample Class
16 public void launchFrame() {
17 // Add bw and bc buttons in the frame border
18 f.add(bw, BorderLayout.WEST);
19 f.add(bc, BorderLayout.CENTER);
20 // Create panel for the buttons in the north border
21 p = new Panel();
22 p.add(bfile);
23 p.add(bhelp);
24 f.add(p, BorderLayout.NORTH);
25 // Pack the frame and make it visible
26 f.pack();
27 f.setVisible(true);
28 }
29
30 public static void main(String args[]) {
31 ComplexLayoutExample gui = new ComplexLayoutExample();
32 gui.launchFrame();
33 }
34 }