charvax.swing

Class BoxLayout

Implemented Interfaces:
LayoutManager

public class BoxLayout
extends java.lang.Object
implements LayoutManager

A concrete implementation of LayoutManager that lays out its components horizontally or vertically.

Field Summary

static int
X_AXIS
static int
Y_AXIS

Constructor Summary

BoxLayout(Container target_, int axis_)
Creates a layout manager that will lay out its components either left-to-right or top-to-bottom, as specified by the axis_ parameter.

Method Summary

void
doLayout(Container container_)
This is called when the size of the container has already been calculated.
Dimension
minimumSize(Container container_)
Calculate the minimum-size rectangle that can enclose all the components in the given container.

Field Details

X_AXIS

public static final int X_AXIS
Field Value:
100

Y_AXIS

public static final int Y_AXIS
Field Value:
101

Constructor Details

BoxLayout

public BoxLayout(Container target_,
                 int axis_)
Creates a layout manager that will lay out its components either left-to-right or top-to-bottom, as specified by the axis_ parameter.
Parameters:
target_ - The container to be laid out. This parameter is not used, but is present for compatibility with the javax.swing.BoxLayout constructor).
axis_ - The axis in which components wil be laid out. Must be X_AXIS or Y_AXIS.

Method Details

doLayout

public void doLayout(Container container_)
This is called when the size of the container has already been calculated. It just lays out the components according to the specified alignment.
Specified by:
doLayout in interface LayoutManager

minimumSize

public Dimension minimumSize(Container container_)
Calculate the minimum-size rectangle that can enclose all the components in the given container.
Specified by:
minimumSize in interface LayoutManager