java.awt
Class BorderLayout

java.lang.Object
  |
  +--java.awt.BorderLayout
All Implemented Interfaces:
LayoutManager

public class BorderLayout
extends Object
implements LayoutManager

A TNT style border bag layout. It will layout a container using members named "North", "South", "East", "West" and "Center". The "North", "South", "East" and "West" components get layed out according to their preferred sizes and the constraints of the container's size. The "Center" component will get any space left over.


Constructor Summary
BorderLayout()
          Constructs a new BorderLayout.
BorderLayout(int hgap, int vgap)
          Constructs a BorderLayout with the specified gaps.
 
Method Summary
 void addLayoutComponent(String name, Component comp)
          Adds the specified named component to the layout.
 void layoutContainer(Container target)
          Lays out the specified container.
 Dimension minimumLayoutSize(Container target)
          Returns the minimum dimensions needed to layout the components contained in the specified target container.
 Dimension preferredLayoutSize(Container target)
          Returns the preferred dimensions for this layout given the components in the specified target container.
 void removeLayoutComponent(Component comp)
          Removes the specified component from the layout.
 String toString()
          Returns the String representation of this BorderLayout's values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BorderLayout

public BorderLayout()
Constructs a new BorderLayout.


BorderLayout

public BorderLayout(int hgap,
                    int vgap)
Constructs a BorderLayout with the specified gaps.

Parameters:
hgap - the horizontal gap
vgap - the vertical gap
Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Adds the specified named component to the layout.

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
name - the String name
comp - the component to be added

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be removed

minimumLayoutSize

public Dimension minimumLayoutSize(Container target)
Returns the minimum dimensions needed to layout the components contained in the specified target container.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
target - the Container on which to do the layout
See Also:
Container, preferredLayoutSize(java.awt.Container)

preferredLayoutSize

public Dimension preferredLayoutSize(Container target)
Returns the preferred dimensions for this layout given the components in the specified target container.

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
target - the component which needs to be laid out
See Also:
Container, minimumLayoutSize(java.awt.Container)

layoutContainer

public void layoutContainer(Container target)
Lays out the specified container. This method will actually reshape the components in the specified target container in order to satisfy the constraints of the BorderLayout object.

Specified by:
layoutContainer in interface LayoutManager
Parameters:
target - the component being laid out
See Also:
Container

toString

public String toString()
Returns the String representation of this BorderLayout's values.

Overrides:
toString in class Object