javax.swing
public class BoxLayout extends Object implements LayoutManager2, Serializable
Field Summary | |
---|---|
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 Summary | |
---|---|
BoxLayout(Container container, int way)
Constructs a BoxLayout object.
|
Method Summary | |
---|---|
void | addLayoutComponent(String name, Component component)
Adds a component to the layout. |
void | addLayoutComponent(Component child, Object constraints)
Adds a component to the layout. |
float | getLayoutAlignmentX(Container parent)
Returns the alignment along the X axis for the container.
|
float | getLayoutAlignmentY(Container parent)
Returns the alignment along the Y axis for the container.
|
void | invalidateLayout(Container parent)
Invalidates the layout.
|
void | layoutContainer(Container parent)
Lays out the specified container using this layout.
|
Dimension | maximumLayoutSize(Container parent)
Returns the maximum size of the layout gived the components
in the given container.
|
Dimension | minimumLayoutSize(Container parent)
Returns the minimum size of the layout.
|
Dimension | preferredLayoutSize(Container parent)
Returns the preferred size of the layout.
|
void | removeLayoutComponent(Component component)
Removes a component from the layout. |
BoxLayout
object.
Parameters: container The container that needs to be laid out. way The orientation of the components.
Throws: AWTError If way has an invalid value.
Parameters: name The name of the component to add. component the component to add to the layout.
Parameters: child The component to add to the layout. constraints The constraints for the component in the layout.
Parameters: parent The container that needs to be laid out.
Returns: The alignment.
Parameters: parent The container that needs to be laid out.
Returns: The alignment.
Parameters: parent The container that needs to be laid out.
Parameters: parent The container that needs to be laid out.
Parameters: parent The container that needs to be laid out.
Returns: The dimension of the layout.
Parameters: parent The container that needs to be laid out.
Returns: The dimension of the layout.
Parameters: parent The container that needs to be laid out.
Returns: The dimension of the layout.
Parameters: component The component to remove from the layout.