Specifications
Sun Services
Java™ Programming Language
Module 10, slide 13 of 37
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
The FrameWithPanel Class
11
12 public void launchFrame() {
13 f.setSize(200,200);
14 f.setBackground(Color.blue);
15 f.setLayout(null); // Use default layout
16
17 pan.setSize(100,100);
18 pan.setBackground(Color.yellow);
19 f.add(pan);
20 f.setVisible(true);
21 }
22
23 public static void main(String args[]) {
24 FrameWithPanel guiWindow =
25 new FrameWithPanel("Frame with Panel");
26 guiWindow.launchFrame();
27 }
28 }










