// File: ex3.java (Module 9) // // Author: Rahul Simha // Created: October 13, 1998 // // Template for Ex 9.3. import java.awt.*; class NewFrame extends Frame { int width, height; int originx, originy; int draw_width, draw_height; // Constructors. public NewFrame (int width, int height) { // Set the title and other parameters. this.setTitle ("Chessboard v2"); this.setResizable (true); this.setBackground (Color.cyan); this.setSize (width, height); this.width = width; this.height = height; // Show the frame. this.setVisible (true); // Compute insets. Insets I = this.getInsets (); originx = 0+I.left; originy = 0+I.top; draw_width = width - (I.right + 1); draw_height = height - (I.bottom + 1); } // No-parameter constructor - use a default size. public NewFrame () { this (500, 300); } // Override paint(): public void paint (Graphics g) { } } public class ex3 { public static void main (String[] argv) { NewFrame nf = new NewFrame (500, 300); } }