// File: TestSwing2.java (Module 9) // // Author: Rahul Simha // Created: October 13, 2000 // // A simple Frame. import java.awt.*; import javax.swing.*; public class TestSwing2 { public static void main (String[] argv) { // Create a Frame instance. JFrame f = new JFrame (); // Set the size. f.setSize (200, 100); // Install a title for the titlebar. f.setTitle ("A Test Window"); // A background color: // First, extract the contentPane Container cPane = f.getContentPane(); // Then, set its color. cPane.setBackground (Color.cyan); // Display. f.setVisible (true); } }