// File: TestAwt19.java (Module 9) // // Author: Rahul Simha // Created: October 21, 1998 // // Quit button - using FlowLayout. import java.awt.*; class NewFrame extends Frame { // Constructor. public NewFrame (int width, int height) { // Set the title and other frame parameters. this.setTitle ("Button example"); this.setResizable (true); this.setBackground (Color.cyan); this.setSize (width, height); // Create a new button. Button b = new Button ("Quit"); // Use a FlowLayout manager. this.setLayout (new FlowLayout()); // Add the button to the frame. this.add (b); // Show the frame. this.setVisible (true); } } // End of class "NewFrame" public class TestAwt21 { public static void main (String[] argv) { NewFrame nf = new NewFrame (300, 200); } }