Java Reference
In-Depth Information
Display 17.6
A
JFrame
with Color
(part 2 of 2)
1
import
java.awt.Color;
This is the file
ColoredWindow.java
.
2
public class
DemoColoredWindow
3{
4
public static void
main(String[] args)
5
{
6
ColoredWindow w1 =
new
ColoredWindow();
7
w1.setVisible(
true
);
8
ColoredWindow w2 =
new
ColoredWindow(Color.GRAY);
9
w2.setVisible(
true
);
10
}
11
}
R
ESULTING
GUI
You will need to use your mouse to
drag the top window or you will not
see the bottom window.