FlowLayout subclass that fully supports wrapping of components.
| Modifiers | Name | Description |
|---|---|---|
private Dimension |
preferredLayoutSize |
| Fields inherited from class | Fields |
|---|---|
class FlowLayout |
LEFT, CENTER, RIGHT, LEADING, TRAILING |
| Constructor and description |
|---|
WrapLayout
()Constructs a new WrapLayout with a left alignment and a
default 5-unit horizontal and vertical gap. |
WrapLayout
(int align)Constructs a new FlowLayout with the specified alignment and a
default 5-unit horizontal and vertical gap. |
WrapLayout
(int align, int hgap, int vgap)Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps. |
| Type | Name and description |
|---|---|
private void |
addRow(Dimension dim, int rowWidth, int rowHeight) |
void |
layoutContainer(Container target)Layout the components in the Container using the layout logic of the parent FlowLayout class. |
private Dimension |
layoutSize(Container target, boolean preferred)Returns the minimum or preferred dimension needed to layout the target container. |
Dimension |
minimumLayoutSize(Container target)Returns the minimum dimensions needed to layout the visible components contained in the specified target container. |
Dimension |
preferredLayoutSize(Container target)Returns the preferred dimensions for this layout given the visible components in the specified target container. |
| Methods inherited from class | Name |
|---|---|
class FlowLayout |
toString, addLayoutComponent, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, getAlignment, setAlignment, getHgap, getVgap, setHgap, setVgap, getAlignOnBaseline, setAlignOnBaseline, getClass, hashCode, equals, notify, notifyAll, wait, wait, wait |
class Object |
getClass, hashCode, equals, toString, notify, notifyAll, wait, wait, wait |
Constructs a new WrapLayout with a left alignment and a
default 5-unit horizontal and vertical gap.
Constructs a new FlowLayout with the specified alignment and a
default 5-unit horizontal and vertical gap. The value of the alignment
argument must be one of WrapLayout, WrapLayout,
or WrapLayout.
align - the alignment valueCreates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps.
The value of the alignment argument must be one of WrapLayout,
WrapLayout, or WrapLayout.
align - the alignment valuehgap - the horizontal gap between componentsvgap - the vertical gap between componentsLayout the components in the Container using the layout logic of the parent FlowLayout class.
target - the Container using this WrapLayoutReturns the minimum or preferred dimension needed to layout the target container.
target - target to get layout size forpreferred - should preferred size be calculatedReturns the minimum dimensions needed to layout the visible components contained in the specified target container.
target - the component which needs to be laid outReturns the preferred dimensions for this layout given the visible components in the specified target container.
target - the component which needs to be laid out