/* * Gary Cornell and Cay S. Horstmann, Core Java (Book/CD-ROM) * Published By SunSoft Press/Prentice-Hall * Copyright (C) 1996 Sun Microsystems Inc. * All Rights Reserved. ISBN 0-13-565755-5 * * Permission to use, copy, modify, and distribute this * software and its documentation for NON-COMMERCIAL purposes * and without fee is hereby granted provided that this * copyright notice appears in all copies. * * THE AUTHORS AND PUBLISHER MAKE NO REPRESENTATIONS OR * WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHORS * AND PUBLISHER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED * BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. */ /** * @version 1.00 07 Feb 1996 * @author Cay Horstmann */ import java.awt.*; public class BorderLayoutTest extends Frame { public BorderLayoutTest() { setTitle("BorderLayoutTest"); Panel p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.LEFT)); p.add(new Button("Left")); p.add(new Button("Right")); p.add(new Button("Up")); p.add(new Button("Down")); p.add(new Button("Close")); add("North", p); add("East", new Scrollbar(Scrollbar.VERTICAL)); add("South", new Scrollbar(Scrollbar.HORIZONTAL)); } public boolean handleEvent(Event evt) { if (evt.id == Event.WINDOW_DESTROY) System.exit(0); return super.handleEvent(evt); } public static void main(String[] args) { Frame f = new BorderLayoutTest(); f.resize(300, 200); f.show(); } }