public class ColumnFlowLayout extends Object implements LayoutManager, Serializable
Constructor and Description |
---|
ColumnFlowLayout()
Constructs a new Flow Layout with a centered alignment and a
default 5-unit horizontal and vertical gap.
|
ColumnFlowLayout(int hgap,
int vgap)
Creates a new flow layout manager with the indicated alignment
and the indicated horizontal and vertical gaps.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(String name,
Component comp)
Adds the specified component to the layout.
|
int |
getHgap()
Gets the horizontal gap between components.
|
int |
getVgap()
Gets the vertical gap between components.
|
void |
layoutContainer(Container target)
Lays out the container.
|
Dimension |
minimumLayoutSize(Container target)
Returns the minimum dimensions needed to layout the components
contained in the specified target container.
|
Dimension |
preferredLayoutSize(Container target)
Returns the preferred dimensions for this layout given the components
in the specified target container.
|
void |
removeLayoutComponent(Component comp)
Removes the specified component from the layout.
|
void |
setHgap(int hgap)
Sets the horizontal gap between components.
|
void |
setVgap(int vgap)
Sets the vertical gap between components.
|
String |
toString()
Returns a string representation of this
FlowLayout
object and its values. |
public ColumnFlowLayout()
public ColumnFlowLayout(int hgap, int vgap)
The value of the alignment argument must be one of
FlowLayout.LEFT
, FlowLayout.RIGHT
,
or FlowLayout.CENTER
.
hgap
- the horizontal gap between components.vgap
- the vertical gap between components.public int getHgap()
public void setHgap(int hgap)
hgap
- the horizontal gap between componentspublic int getVgap()
public void setVgap(int vgap)
vgap
- the vertical gap between componentspublic void addLayoutComponent(String name, Component comp)
addLayoutComponent
in interface LayoutManager
name
- the name of the componentcomp
- the component to be addedpublic void removeLayoutComponent(Component comp)
removeLayoutComponent
in interface LayoutManager
comp
- the component to removepublic Dimension preferredLayoutSize(Container target)
preferredLayoutSize
in interface LayoutManager
target
- the component which needs to be laid outpublic Dimension minimumLayoutSize(Container target)
minimumLayoutSize
in interface LayoutManager
target
- the component which needs to be laid outpublic void layoutContainer(Container target)
ColumnFlowLayout
object.layoutContainer
in interface LayoutManager
target
- the specified component being laid out.Copyright © 2003, 2023, Oracle and/or its affiliates.