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 |
X_AXIS_NO_GROW
Horizontal layout where components are arranged from left to right but don't grow vertically beyond their preferred size
|
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 |
---|---|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
int |
getAxis()
Returns the layout axis x/y
|
Dimension |
getPreferredSize(Container parent)
Returns the container preferred size
|
void |
layoutContainer(Container parent)
Layout the given parent container children
|
String |
toString()
Returns a string representation of the object.
|
addLayoutComponent, getComponentConstraint, hashCode, isConstraintTracking, isOverlapSupported, obscuresPotential, removeLayoutComponent
public static final int X_AXIS
public static final int Y_AXIS
public static final int X_AXIS_NO_GROW
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 containerpublic int getAxis()
public String toString()
Object
public boolean equals(Object o)
Object