All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.FlowLayout

java.lang.Object
   |
   +----java.awt.FlowLayout

public class FlowLayout
extends Object
implements LayoutManager, Serializable
Flow layout is used to layout buttons in a panel. It will arrange buttons left to right until no more buttons fit on the same line. Each line is centered.


Variable Index

 o CENTER
The right alignment variable.
 o LEFT
The left alignment variable.
 o RIGHT
The right alignment variable.

Constructor Index

 o FlowLayout()
Constructs a new Flow Layout with a centered alignment and a default 5-unit horizontal and vertical gap.
 o FlowLayout(int)
Constructs a new Flow Layout with the specified alignment and a default 5-unit horizontal and vertical gap.
 o FlowLayout(int, int, int)
Constructs a new Flow Layout with the specified alignment and gap values.

Method Index

 o addLayoutComponent(String, Component)
Adds the specified component to the layout.
 o getAlignment()
Returns the alignment value for this layout, one of LEFT, CENTER, or RIGHT.
 o getHgap()
Returns the horizontal gap between components.
 o getVgap()
Returns the vertical gap between components.
 o layoutContainer(Container)
Lays out the container.
 o minimumLayoutSize(Container)
Returns the minimum dimensions needed to layout the components contained in the specified target container.
 o preferredLayoutSize(Container)
Returns the preferred dimensions for this layout given the components in the specified target container.
 o removeLayoutComponent(Component)
Removes the specified component from the layout.
 o setAlignment(int)
Sets the alignment value for this layout.
 o setHgap(int)
Sets the horizontal gap between components.
 o setVgap(int)
Sets the vertical gap between components.
 o toString()
Returns the String representation of this FlowLayout's values.

Variables

 o LEFT
 public static final int LEFT
The left alignment variable.

 o CENTER
 public static final int CENTER
The right alignment variable.

 o RIGHT
 public static final int RIGHT
The right alignment variable.

Constructors

 o FlowLayout
 public FlowLayout()
Constructs a new Flow Layout with a centered alignment and a default 5-unit horizontal and vertical gap.

 o FlowLayout
 public FlowLayout(int align)
Constructs a new Flow Layout with the specified alignment and a default 5-unit horizontal and vertical gap.

Parameters:
align - the alignment value
 o FlowLayout
 public FlowLayout(int align,
                   int hgap,
                   int vgap)
Constructs a new Flow Layout with the specified alignment and gap values.

Parameters:
align - the alignment value
hgap - the horizontal gap variable
vgap - the vertical gap variable

Methods

 o getAlignment
 public int getAlignment()
Returns the alignment value for this layout, one of LEFT, CENTER, or RIGHT.

 o setAlignment
 public void setAlignment(int align)
Sets the alignment value for this layout.

Parameters:
align - the alignment value, one of LEFT, CENTER, or RIGHT.
 o getHgap
 public int getHgap()
Returns the horizontal gap between components.

 o setHgap
 public void setHgap(int hgap)
Sets the horizontal gap between components.

Parameters:
hgap - the horizontal gap between components
 o getVgap
 public int getVgap()
Returns the vertical gap between components.

 o setVgap
 public void setVgap(int vgap)
Sets the vertical gap between components.

Parameters:
vgap - the vertical gap between components
 o addLayoutComponent
 public void addLayoutComponent(String name,
                                Component comp)
Adds the specified component to the layout. Not used by this class.

Parameters:
name - the name of the component
comp - the the component to be added
 o removeLayoutComponent
 public void removeLayoutComponent(Component comp)
Removes the specified component from the layout. Not used by this class.

Parameters:
comp - the component to remove
 o preferredLayoutSize
 public Dimension preferredLayoutSize(Container target)
Returns the preferred dimensions for this layout given the components in the specified target container.

Parameters:
target - the component which needs to be laid out
See Also:
Container, minimumLayoutSize
 o minimumLayoutSize
 public Dimension minimumLayoutSize(Container target)
Returns the minimum dimensions needed to layout the components contained in the specified target container.

Parameters:
target - the component which needs to be laid out
See Also:
preferredLayoutSize
 o layoutContainer
 public void layoutContainer(Container target)
Lays out the container. This method will actually reshape the components in the target in order to satisfy the constraints of the BorderLayout object.

Parameters:
target - the specified component being laid out.
See Also:
Container
 o toString
 public String toString()
Returns the String representation of this FlowLayout's values.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index