1 /*
2 * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
75 * and {@code PAGE_START} constants in a container whose
76 * orientation is {@code LEFT_TO_RIGHT}, only the
77 * {@code PAGE_START} will be laid out.
78 * <p>
79 * NOTE: Currently,
80 * {@code BorderLayout} does not support vertical
81 * orientations. The {@code isVertical} setting on the container's
82 * {@code ComponentOrientation} is not respected.
83 * <p>
84 * The components are laid out according to their
85 * preferred sizes and the constraints of the container's size.
86 * The {@code NORTH} and {@code SOUTH} components may
87 * be stretched horizontally; the {@code EAST} and
88 * {@code WEST} components may be stretched vertically;
89 * the {@code CENTER} component may stretch both horizontally
90 * and vertically to fill any space left over.
91 * <p>
92 * Here is an example of five buttons in an applet laid out using
93 * the {@code BorderLayout} layout manager:
94 * <p>
95 * <img src="doc-files/BorderLayout-1.gif"
96 * alt="Diagram of an applet demonstrating BorderLayout.
97 * Each section of the BorderLayout contains a Button corresponding to its position in the layout, one of:
98 * North, West, Center, East, or South."
99 * style="float:center; margin: 7px 10px;">
100 * <p>
101 * The code for this applet is as follows:
102 *
103 * <hr><blockquote><pre>
104 * import java.awt.*;
105 * import java.applet.Applet;
106 *
107 * public class buttonDir extends Applet {
108 * public void init() {
109 * setLayout(new BorderLayout());
110 * add(new Button("North"), BorderLayout.NORTH);
111 * add(new Button("South"), BorderLayout.SOUTH);
112 * add(new Button("East"), BorderLayout.EAST);
113 * add(new Button("West"), BorderLayout.WEST);
114 * add(new Button("Center"), BorderLayout.CENTER);
115 * }
116 * }
117 * </pre></blockquote><hr>
118 *
119 * @author Arthur van Hoff
|
1 /*
2 * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
75 * and {@code PAGE_START} constants in a container whose
76 * orientation is {@code LEFT_TO_RIGHT}, only the
77 * {@code PAGE_START} will be laid out.
78 * <p>
79 * NOTE: Currently,
80 * {@code BorderLayout} does not support vertical
81 * orientations. The {@code isVertical} setting on the container's
82 * {@code ComponentOrientation} is not respected.
83 * <p>
84 * The components are laid out according to their
85 * preferred sizes and the constraints of the container's size.
86 * The {@code NORTH} and {@code SOUTH} components may
87 * be stretched horizontally; the {@code EAST} and
88 * {@code WEST} components may be stretched vertically;
89 * the {@code CENTER} component may stretch both horizontally
90 * and vertically to fill any space left over.
91 * <p>
92 * Here is an example of five buttons in an applet laid out using
93 * the {@code BorderLayout} layout manager:
94 * <p>
95 * <img src="doc-files/BorderLayout-1.gif" alt="Diagram of an applet
96 * demonstrating BorderLayout. Each section of the BorderLayout contains a
97 * Button corresponding to its position in the layout, one of: North, West,
98 * Center, East, or South." style="margin: 7px 10px;">
99 * <p>
100 * The code for this applet is as follows:
101 *
102 * <hr><blockquote><pre>
103 * import java.awt.*;
104 * import java.applet.Applet;
105 *
106 * public class buttonDir extends Applet {
107 * public void init() {
108 * setLayout(new BorderLayout());
109 * add(new Button("North"), BorderLayout.NORTH);
110 * add(new Button("South"), BorderLayout.SOUTH);
111 * add(new Button("East"), BorderLayout.EAST);
112 * add(new Button("West"), BorderLayout.WEST);
113 * add(new Button("Center"), BorderLayout.CENTER);
114 * }
115 * }
116 * </pre></blockquote><hr>
117 *
118 * @author Arthur van Hoff
|