public class BoxLayout extends Layout
Modifier and Type | Field and Description |
---|---|
static int |
X_AXIS
Horizontal layout where components are arranged from left to right
|
static int |
Y_AXIS
Vertical layout where components are arranged from top to bottom
|
Constructor and Description |
---|
BoxLayout(int axis)
Creates a new instance of BoxLayout
|
Modifier and Type | Method and Description |
---|---|
Dimension |
getPreferredSize(Container parent)
Returns the container preferred size
|
void |
layoutContainer(Container parent)
Layout the given parent container children
|
addLayoutComponent, getComponentConstraint, isOverlapSupported, removeLayoutComponent
public static final int X_AXIS
public static final int Y_AXIS
public BoxLayout(int axis)
axis
- the axis to lay out components along.
Can be: BoxLayout.X_AXIS or BoxLayout.Y_AXISpublic void layoutContainer(Container parent)
Layout
layoutContainer
in class Layout
parent
- the given parent containerpublic Dimension getPreferredSize(Container parent)
Layout
getPreferredSize
in class Layout
parent
- the parent container