<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.awt.FlowLayout
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.FileDialog.html#_top_">Previous</a>  <a href="java.awt.Font.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.FlowLayout
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.awt.FlowLayout
</pre>
<hr>
<dl>
  <dt> public class <b>FlowLayout</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
  <dt> implements <a href="java.awt.LayoutManager.html#_top_">LayoutManager</a>, <a href="java.io.Serializable.html#_top_">Serializable</a>
</dl>
A flow layout arranges components in a left-to-right flow, much 
 like lines of text in a paragraph. Flow layouts are typically used 
 to arrange buttons in a panel. It will arrange
 buttons left to right until no more buttons fit on the same line.
 Each line is centered.
 <p>
 For example, the following picture shows an applet using the flow 
 layout manager (its default layout manager) to position three buttons:
 <p>
 <img src="images-awt/FlowLayout-1.gif" 
 ALT="Graphic of Layout for Three Buttons" 
 ALIGN=center HSPACE=10 VSPACE=7>
 <p>
 Here is the code for this applet: 
 <p>
 <hr><blockquote><pre>
 import java.awt.*;
 import java.applet.Applet;
 public class myButtons extends Applet {
     Button button1, button2, button3;
     public void init() {
         button1 = new Button("Ok");
         button2 = new Button("Open");
         button3 = new Button("Close");
         add(button1);
         add(button2);
         add(button3);
     }
 }
 </pre></blockquote><hr>
 <p>
 A flow layout lets each component assume its natural (preferred) size.
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#CENTER"><b>CENTER</b></a>
  <dd>  This value indicates that each row of components
 should be centered.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#LEFT"><b>LEFT</b></a>
  <dd>  This value indicates that each row of components
 should be left-justified.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#RIGHT"><b>RIGHT</b></a>
  <dd>  This value indicates that each row of components
 should be right-justified.
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#FlowLayout()"><b>FlowLayout</b></a>()
  <dd>  Constructs a new Flow Layout with a centered alignment and a
 default 5-unit horizontal and vertical gap.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#FlowLayout(int)"><b>FlowLayout</b></a>(int)
  <dd>  Constructs a new Flow Layout with the specified alignment and a
 default 5-unit horizontal and vertical gap.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#FlowLayout(int, int, int)"><b>FlowLayout</b></a>(int, int, int)
  <dd>  Creates a new flow layout manager with the indicated alignment 
 and the indicated horizontal and vertical gaps.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addLayoutComponent(java.lang.String, java.awt.Component)"><b>addLayoutComponent</b></a>(String, Component)
  <dd>  Adds the specified component to the layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAlignment()"><b>getAlignment</b></a>()
  <dd>  Gets the alignment for this layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHgap()"><b>getHgap</b></a>()
  <dd>  Gets the horizontal gap between components.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getVgap()"><b>getVgap</b></a>()
  <dd>  Gets the vertical gap between components.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#layoutContainer(java.awt.Container)"><b>layoutContainer</b></a>(Container)
  <dd>  Lays out the container.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#minimumLayoutSize(java.awt.Container)"><b>minimumLayoutSize</b></a>(Container)
  <dd>  Returns the minimum dimensions needed to layout the components
 contained in the specified target container.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#preferredLayoutSize(java.awt.Container)"><b>preferredLayoutSize</b></a>(Container)
  <dd>  Returns the preferred dimensions for this layout given the components
 in the specified target container.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeLayoutComponent(java.awt.Component)"><b>removeLayoutComponent</b></a>(Component)
  <dd>  Removes the specified component from the layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setAlignment(int)"><b>setAlignment</b></a>(int)
  <dd>  Sets the alignment for this layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setHgap(int)"><b>setHgap</b></a>(int)
  <dd>  Sets the horizontal gap between components.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setVgap(int)"><b>setVgap</b></a>(int)
  <dd>  Sets the vertical gap between components.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Returns a string representation of this <code>FlowLayout</code>
 object and its values.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="LEFT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>LEFT</b>
<pre>
 public static final int LEFT
</pre>
<dl>
  <dd> This value indicates that each row of components
 should be left-justified.<p>
</dl>
<a name="CENTER"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>CENTER</b>
<pre>
 public static final int CENTER
</pre>
<dl>
  <dd> This value indicates that each row of components
 should be centered.<p>
</dl>
<a name="RIGHT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>RIGHT</b>
<pre>
 public static final int RIGHT
</pre>
<dl>
  <dd> This value indicates that each row of components
 should be right-justified.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="FlowLayout"></a>
<a name="FlowLayout()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>FlowLayout</b>
<pre>
 public FlowLayout()
</pre>
<dl>
  <dd> Constructs a new Flow Layout with a centered alignment and a
 default 5-unit horizontal and vertical gap.
<p>
</dl>
<a name="FlowLayout(int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>FlowLayout</b>
<pre>
 public FlowLayout(int align)
</pre>
<dl>
  <dd> Constructs a new Flow Layout with the specified alignment and a
 default 5-unit horizontal and vertical gap.
 The value of the alignment argument must be one of 
 <code>FlowLayout.LEFT</code>, <code>FlowLayout.RIGHT</code>, 
 or <code>FlowLayout.CENTER</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> align - the alignment value
  </dl></dd>
</dl>
<a name="FlowLayout(int, int, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>FlowLayout</b>
<pre>
 public FlowLayout(int align,
                   int hgap,
                   int vgap)
</pre>
<dl>
  <dd> Creates a new flow layout manager with the indicated alignment 
 and the indicated horizontal and vertical gaps. 
 <p>
 The value of the alignment argument must be one of 
 <code>FlowLayout.LEFT</code>, <code>FlowLayout.RIGHT</code>, 
 or <code>FlowLayout.CENTER</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> align - the alignment value.
    <dd> hgap - the horizontal gap between components.
    <dd> vgap - the vertical gap between components.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getAlignment()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAlignment"><b>getAlignment</b></a>
<pre>
 public int getAlignment()
</pre>
<dl>
  <dd> Gets the alignment for this layout.
 Possible values are <code>FlowLayout.LEFT</code>,  
 <code>FlowLayout.RIGHT</code>, or <code>FlowLayout.CENTER</code>.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the alignment value for this layout.
    <dt> <b>See Also:</b>
    <dd> <a href="#setAlignment">setAlignment</a>
  </dl></dd>
</dl>
<a name="setAlignment(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setAlignment"><b>setAlignment</b></a>
<pre>
 public void setAlignment(int align)
</pre>
<dl>
  <dd> Sets the alignment for this layout.
 Possible values are <code>FlowLayout.LEFT</code>,  
 <code>FlowLayout.RIGHT</code>, and <code>FlowLayout.CENTER</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> align - the alignment value.
    <dt> <b>See Also:</b>
    <dd> <a href="#getAlignment">getAlignment</a>
  </dl></dd>
</dl>
<a name="getHgap()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHgap"><b>getHgap</b></a>
<pre>
 public int getHgap()
</pre>
<dl>
  <dd> Gets the horizontal gap between components.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the horizontal gap between components.
    <dt> <b>See Also:</b>
    <dd> <a href="#setHgap">setHgap</a>
  </dl></dd>
</dl>
<a name="setHgap(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setHgap"><b>setHgap</b></a>
<pre>
 public void setHgap(int hgap)
</pre>
<dl>
  <dd> Sets the horizontal gap between components.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> hgap - the horizontal gap between components
    <dt> <b>See Also:</b>
    <dd> <a href="#getHgap">getHgap</a>
  </dl></dd>
</dl>
<a name="getVgap()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getVgap"><b>getVgap</b></a>
<pre>
 public int getVgap()
</pre>
<dl>
  <dd> Gets the vertical gap between components.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the vertical gap between components.
    <dt> <b>See Also:</b>
    <dd> <a href="#setVgap">setVgap</a>
  </dl></dd>
</dl>
<a name="setVgap(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setVgap"><b>setVgap</b></a>
<pre>
 public void setVgap(int vgap)
</pre>
<dl>
  <dd> Sets the vertical gap between components.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> vgap - the vertical gap between components
    <dt> <b>See Also:</b>
    <dd> <a href="#getVgap">getVgap</a>
  </dl></dd>
</dl>
<a name="addLayoutComponent(java.lang.String, java.awt.Component)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addLayoutComponent"><b>addLayoutComponent</b></a>
<pre>
 public void addLayoutComponent(<a href="java.lang.String.html#_top_">String</a> name,
                                <a href="java.awt.Component.html#_top_">Component</a> comp)
</pre>
<dl>
  <dd> Adds the specified component to the layout. Not used by this class.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the name of the component
    <dd> comp - the component to be added
  </dl></dd>
</dl>
<a name="removeLayoutComponent(java.awt.Component)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeLayoutComponent"><b>removeLayoutComponent</b></a>
<pre>
 public void removeLayoutComponent(<a href="java.awt.Component.html#_top_">Component</a> comp)
</pre>
<dl>
  <dd> Removes the specified component from the layout. Not used by
 this class.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comp - the component to remove
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#removeAll">removeAll</a>
  </dl></dd>
</dl>
<a name="preferredLayoutSize(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="preferredLayoutSize"><b>preferredLayoutSize</b></a>
<pre>
 public <a href="java.awt.Dimension.html#_top_">Dimension</a> preferredLayoutSize(<a href="java.awt.Container.html#_top_">Container</a> target)
</pre>
<dl>
  <dd> Returns the preferred dimensions for this layout given the components
 in the specified target container.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> target - the component which needs to be laid out
    <dt> <b>Returns:</b>
    <dd> the preferred dimensions to lay out the
                    subcomponents of the specified container.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#_top_">Container</a>, <a href="#minimumLayoutSize">minimumLayoutSize</a>, <a href="java.awt.Container.html#getPreferredSize">getPreferredSize</a>
  </dl></dd>
</dl>
<a name="minimumLayoutSize(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="minimumLayoutSize"><b>minimumLayoutSize</b></a>
<pre>
 public <a href="java.awt.Dimension.html#_top_">Dimension</a> minimumLayoutSize(<a href="java.awt.Container.html#_top_">Container</a> target)
</pre>
<dl>
  <dd> Returns the minimum dimensions needed to layout the components
 contained in the specified target container.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> target - the component which needs to be laid out
    <dt> <b>Returns:</b>
    <dd> the minimum dimensions to lay out the
                    subcomponents of the specified container.
    <dt> <b>See Also:</b>
    <dd> <a href="#preferredLayoutSize">preferredLayoutSize</a>, <a href="java.awt.Container.html#_top_">Container</a>, <a href="java.awt.Container.html#doLayout">doLayout</a>
  </dl></dd>
</dl>
<a name="layoutContainer(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="layoutContainer"><b>layoutContainer</b></a>
<pre>
 public void layoutContainer(<a href="java.awt.Container.html#_top_">Container</a> target)
</pre>
<dl>
  <dd> Lays out the container. This method lets each component take 
 its preferred size by reshaping the components in the 
 target container in order to satisfy the constraints of
 this <code>FlowLayout</code> object.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> target - the specified component being laid out.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#_top_">Container</a>, <a href="java.awt.Container.html#doLayout">doLayout</a>
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Returns a string representation of this <code>FlowLayout</code>
 object and its values.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of this layout.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.FileDialog.html#_top_">Previous</a>  <a href="java.awt.Font.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
