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