// File: ex2.java (Module 9) // // Author: Rahul Simha // Created: October 14, 1998 // // Template for Ex. 9.2 (Draw a chessboard). import java.awt.*; class NewFrame extends Frame { // Constructors. public NewFrame (int width, int height) { // Set the title and other parameters. this.setTitle ("Chessboard"); this.setResizable (true); this.setBackground (Color.cyan); this.setSize (width, height); // Show the frame. this.setVisible (true); } // No-parameter constructor - use a default size. public NewFrame () { this (500, 300); } } public class ex2 { public static void main (String[] argv) { NewFrame nf = new NewFrame (500, 300); } }