All Packages Class Hierarchy This Package Previous Next Index
Class com.bulletproof.gui.BorderLayout
java.lang.Object
|
+----com.bulletproof.gui.BorderLayout
- 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".
When you add a component to a container that has a BorderLayout
layout manager, be sure to specify a string for where to add the
component, for example:
Panel p = new Panel();
p.setLayout(new BorderLayout());
p.add(new Button("Okay"), "South");
As a convenience, BorderLayout interprets the absence of a string
specification the same as "Center":
Panel p2 = new Panel();
p2.setLayout(new BorderLayout());
p2.add(new TextArea()); // Same as p.add(new TextArea(), "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.
-
BorderLayout()
- Constructs a BorderLayout.
-
BorderLayout(int, int)
- Constructs a BorderLayout with the specified gap.
-
addLayoutComponent(String, Component)
- Adds the specified component to the layout, using the specified
constraint object.
-
layoutContainer(Container)
- Lays out the specified container.
-
minimumLayoutSize(Container)
- Returns the minimum dimensions needed to layout the components
contained in the specified target container.
-
removeLayoutComponent(Component)
- Removes the specified component from the layout.
-
toString()
-
BorderLayout
public BorderLayout()
- Constructs a BorderLayout.
BorderLayout
public BorderLayout(int hgap,
int vgap)
- Constructs a BorderLayout with the specified gap.
- Parameters:
- hgap - the horizontal gap
- vgap - the vertical gap
addLayoutComponent
public void addLayoutComponent(String where,
Component component)
- Adds the specified component to the layout, using the specified
constraint object.
- Parameters:
- comp - the component to be added
- constraints - where/how the component is added to the layout.
removeLayoutComponent
public void removeLayoutComponent(Component comp)
- Removes the specified component from the layout.
- Parameters:
- comp - the component ot be removed
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.
- Parameters:
- target - the component being laid out
- See Also:
- Container
minimumLayoutSize
public Dimension minimumLayoutSize(Container target)
- Returns the minimum dimensions needed to layout the components
contained in the specified target container.
- Parameters:
- target - the Container on which to do the layout
- See Also:
- Container
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index