home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / solaris2 / jdk / src / java / awt / test / borderte.jav < prev    next >
Encoding:
Text File  |  1995-10-30  |  1.4 KB  |  48 lines

  1. /*
  2.  * @(#)BorderTest.java    1.14 95/08/07 Sami Shaio
  3.  *
  4.  * Copyright (c) 1995 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. import java.awt.*;
  21.  
  22. /**
  23.  * A test of a Container with BorderLayout.
  24.  */
  25. public class BorderTest extends Frame {
  26.     public BorderTest() {
  27.     super("BorderTest");
  28.     setLayout(new BorderLayout(5, 5));
  29.     add("North", new Button("North"));
  30.     add("Center", new Button("Center"));
  31.     add("South", new Button("South"));
  32.     add("West", new Button("West"));
  33.     add("East", new Button("East"));
  34.     move(200, 100);
  35.     pack();
  36.     show();
  37.     }
  38.  
  39.     public boolean handleEvent(Event evt) {
  40.     System.out.println(evt.toString());
  41.     return true;
  42.     }
  43.  
  44.     public static void main(String args[]) {
  45.     new BorderTest();
  46.     }
  47. }
  48.