public class BoxLayout extends java.lang.Object implements java.awt.LayoutManager2, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
LINE_AXIS
Specifies that components are laid out in the direction of a line of text.
|
static int |
PAGE_AXIS
Sepcifies that components are laid out in the direction of the line flow.
|
static int |
X_AXIS
Specifies that components are laid out left to right.
|
static int |
Y_AXIS
Specifies that components are laid out top to bottom.
|
| Constructor and Description |
|---|
BoxLayout(java.awt.Container container,
int way)
Constructs a
BoxLayout object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addLayoutComponent(java.awt.Component child,
java.lang.Object constraints)
Adds a component to the layout.
|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component component)
Adds a component to the layout.
|
float |
getLayoutAlignmentX(java.awt.Container parent)
Returns the alignment along the X axis for the container.
|
float |
getLayoutAlignmentY(java.awt.Container parent)
Returns the alignment along the Y axis for the container.
|
void |
invalidateLayout(java.awt.Container parent)
Invalidates the layout.
|
void |
layoutContainer(java.awt.Container parent)
Lays out the specified container using this layout.
|
java.awt.Dimension |
maximumLayoutSize(java.awt.Container parent)
Returns the maximum size of the layout gived the components
in the given container.
|
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Returns the minimum size of the layout.
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Returns the preferred size of the layout.
|
void |
removeLayoutComponent(java.awt.Component component)
Removes a component from the layout.
|
public static final int X_AXIS
public static final int Y_AXIS
public static final int LINE_AXIS
public static final int PAGE_AXIS
public BoxLayout(java.awt.Container container, int way)
BoxLayout object.container - The container that needs to be laid out.way - The orientation of the components.java.awt.AWTError - If way has an invalid value.public void addLayoutComponent(java.lang.String name, java.awt.Component component)
addLayoutComponent in interface java.awt.LayoutManagername - The name of the component to add.component - the component to add to the layout.public void removeLayoutComponent(java.awt.Component component)
removeLayoutComponent in interface java.awt.LayoutManagercomponent - The component to remove from the layout.public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize in interface java.awt.LayoutManagerparent - The container that needs to be laid out.LayoutManager.minimumLayoutSize(Container)public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize in interface java.awt.LayoutManagerparent - The container that needs to be laid out.LayoutManager.preferredLayoutSize(Container)public void layoutContainer(java.awt.Container parent)
layoutContainer in interface java.awt.LayoutManagerparent - The container that needs to be laid out.public void addLayoutComponent(java.awt.Component child, java.lang.Object constraints)
addLayoutComponent in interface java.awt.LayoutManager2child - The component to add to the layout.constraints - The constraints for the component in the layout.public float getLayoutAlignmentX(java.awt.Container parent)
getLayoutAlignmentX in interface java.awt.LayoutManager2parent - The container that needs to be laid out.public float getLayoutAlignmentY(java.awt.Container parent)
getLayoutAlignmentY in interface java.awt.LayoutManager2parent - The container that needs to be laid out.public void invalidateLayout(java.awt.Container parent)
invalidateLayout in interface java.awt.LayoutManager2parent - The container that needs to be laid out.public java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
maximumLayoutSize in interface java.awt.LayoutManager2parent - The container that needs to be laid out.Component.getMaximumSize()