// File: TestAwt10.java (Module 9) // // Author: Rahul Simha // Created: October 13, 1998 // // Drawing outside the visible area. import java.awt.*; class NewFrame extends Frame { // Constructors. public NewFrame (int width, int height) { // Set the title and other parameters. this.setTitle ("Outside the region"); 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); } // Override paint(): public void paint (Graphics g) { // Draw a wide rectangle: g.fillRect (-100, 100, 800, 50); } } public class TestAwt10 { public static void main (String[] argv) { NewFrame nf = new NewFrame (300, 300); } }