// File: TestAwt20.java (Module 9) // // Author: Rahul Simha // Created: October 21, 1998 // // BorderLayout: all directions. 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); // Add five buttons at the different locations: this.add (new Button ("South"), BorderLayout.SOUTH); this.add (new Button ("North"), BorderLayout.NORTH); this.add (new Button ("East"), BorderLayout.EAST); this.add (new Button ("West"), BorderLayout.WEST); this.add (new Button ("Center"), BorderLayout.CENTER); // Show the frame. this.setVisible (true); } } // End of class "NewFrame" public class TestAwt20 { public static void main (String[] argv) { NewFrame nf = new NewFrame (300, 200); } }