A border layout lays out a container, arranging and resizing
its components to fit in five regions:
north, south, east, west, and center.
Each region may contain no more than one component, and
is identified by a corresponding constant:
NORTH
, SOUTH
, EAST
,
WEST
, and CENTER
. When adding a
component to a container with a border layout, use one of these
five constants, for example:
Panel p = new Panel(); p.setLayout(new BorderLayout()); p.add(new Button("Okay"), BorderLayout.SOUTH);As a convenience,
BorderLayout
interprets the
absence of a string specification the same as the constant
CENTER
:
Panel p2 = new Panel(); p2.setLayout(new BorderLayout()); p2.add(new TextArea()); // Same as p.add(new TextArea(), BorderLayout.CENTER);
static public NORTH:String
static public SOUTH:String
static public EAST:String
static public WEST:String
static public CENTER:String
static public BEFORE_FIRST_LINE:String
static public AFTER_LAST_LINE:String
static public BEFORE_LINE_BEGINS:String
static public AFTER_LINE_ENDS:String
static public PAGE_START:String
static public PAGE_END:String
static public LINE_START:String
static public LINE_END:String
public function addLayoutComponent(comp:Component, constraints:Object):Void
Description copied from EmptyLayout
do nothing
addLayoutComponent() in org.aswing.LayoutManager
public function removeLayoutComponent(comp:Component):Void
Description copied from EmptyLayout
do nothing
removeLayoutComponent() in org.aswing.LayoutManager
public function minimumLayoutSize(target:Container):Dimension
Description copied from EmptyLayout
new Dimension(0, 0);
minimumLayoutSize() in org.aswing.LayoutManager
public function preferredLayoutSize(target:Container):Dimension
Description copied from EmptyLayout
return target.getSize();
preferredLayoutSize() in org.aswing.LayoutManager
public function getLayoutAlignmentX(target:Container):Number
Description copied from EmptyLayout
return 0
getLayoutAlignmentX() in org.aswing.LayoutManager
public function getLayoutAlignmentY(target:Container):Number
Description copied from EmptyLayout
return 0
getLayoutAlignmentY() in org.aswing.LayoutManager
public function layoutContainer(target:Container):Void
Lays out the container argument using this border layout.
This method actually reshapes the components in the specified
container in order to satisfy the constraints of this
BorderLayout
object. The NORTH
and SOUTH
components, if any, are placed at
the top and bottom of the container, respectively. The
WEST
and EAST
components are
then placed on the left and right, respectively. Finally,
the CENTER
object is placed in any remaining
space in the middle.
Most applications do not call this method directly. This method
is called when a container calls its doLayout
method.
target | the container in which to do the layout. |
layoutContainer() in org.aswing.LayoutManager
layoutContainer() in org.aswing.EmptyLayout