<!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.CardLayout
</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.Canvas.html#_top_">Previous</a>  <a href="java.awt.Checkbox.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.CardLayout
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.awt.CardLayout
</pre>
<hr>
<dl>
  <dt> public class <b>CardLayout</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
  <dt> implements <a href="java.awt.LayoutManager2.html#_top_">LayoutManager2</a>, <a href="java.io.Serializable.html#_top_">Serializable</a>
</dl>
A <code>CardLayout</code> object is a layout manager for a 
 container. It treats each component in the container as a card.
 Only one card is visible at a time, and the container acts as
 a stack of cards.  
 <p>
 The ordering of cards is determined by the container's own internal
 ordering of its component objects. <code>CardLayout</code> 
 defines a set of methods that allow an application to flip 
 through these cards sequentially, or to show a specified card.
 The <A HREF="#addLayoutComponent"><code>addLayoutComponent</code></A> 
 method can be used to associate a string identifier with a given card
 for fast random access.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#_top_">Container</a>
</dl>
<hr>
<a name="index"></a>
<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="#CardLayout()"><b>CardLayout</b></a>()
  <dd>  Creates a new card layout with gaps of size zero.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#CardLayout(int, int)"><b>CardLayout</b></a>(int, int)
  <dd>  Creates a new card layout with the specified 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.awt.Component, java.lang.Object)"><b>addLayoutComponent</b></a>(Component, Object)
  <dd>  Adds the specified component to this card layout's internal
 table of names.
  <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>  
<b>Deprecated.</b>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#first(java.awt.Container)"><b>first</b></a>(Container)
  <dd>  Flips to the first card of the container.
  <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="#getLayoutAlignmentX(java.awt.Container)"><b>getLayoutAlignmentX</b></a>(Container)
  <dd>  Returns the alignment along the x axis.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLayoutAlignmentY(java.awt.Container)"><b>getLayoutAlignmentY</b></a>(Container)
  <dd>  Returns the alignment along the y axis.
  <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="#invalidateLayout(java.awt.Container)"><b>invalidateLayout</b></a>(Container)
  <dd>  Invalidates the layout, indicating that if the layout manager
 has cached information it should be discarded.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#last(java.awt.Container)"><b>last</b></a>(Container)
  <dd>  Flips to the last card of the container.
  <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 specified container using this card layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#maximumLayoutSize(java.awt.Container)"><b>maximumLayoutSize</b></a>(Container)
  <dd>  Returns the maximum 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="#minimumLayoutSize(java.awt.Container)"><b>minimumLayoutSize</b></a>(Container)
  <dd> 
 Calculates the minimum size for the specified panel.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#next(java.awt.Container)"><b>next</b></a>(Container)
  <dd>  Flips to the next card of the specified 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> 
 Determines the preferred size of the container argument using 
 this card layout.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#previous(java.awt.Container)"><b>previous</b></a>(Container)
  <dd>  Flips to the previous card of the specified 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="#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="#show(java.awt.Container, java.lang.String)"><b>show</b></a>(Container, String)
  <dd>  Flips to the component that was added to this layout with the  
 specified <code>name</code>, using <code>addLayoutComponent</code>.
  <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 the state of this card layout.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="CardLayout"></a>
<a name="CardLayout()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>CardLayout</b>
<pre>
 public CardLayout()
</pre>
<dl>
  <dd> Creates a new card layout with gaps of size zero.
<p>
</dl>
<a name="CardLayout(int, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>CardLayout</b>
<pre>
 public CardLayout(int hgap,
                   int vgap)
</pre>
<dl>
  <dd> Creates a new card layout with the specified horizontal and 
 vertical gaps. The horizontal gaps are placed at the left and 
 right edges. The vertical gaps are placed at the top and bottom 
 edges.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> hgap - the horizontal gap.
    <dd> vgap - the vertical gap.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<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(int)">setHgap</a>, <a href="#getVgap()">getVgap</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>, <a href="#setVgap(int)">setVgap</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(int)">setVgap</a>, <a href="#getHgap()">getHgap</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>, <a href="#setHgap(int)">setHgap</a>
  </dl></dd>
</dl>
<a name="addLayoutComponent(java.awt.Component, java.lang.Object)"><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.awt.Component.html#_top_">Component</a> comp,
                                <a href="java.lang.Object.html#_top_">Object</a> constraints)
</pre>
<dl>
  <dd> Adds the specified component to this card layout's internal
 table of names. The object specified by <code>constraints</code>  
 must be a string. The card layout stores this string as a key-value
 pair that can be used for random access to a particular card.
 By calling the <code>show</code> method, an application can  
 display the component with the specified name.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comp - the component to be added.
    <dd> constraints - a tag that identifies a particular
                                        card in the layout.
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if the constraint is not a string.
    <dt> <b>See Also:</b>
    <dd> <a href="#show(java.awt.Container, java.lang.String)">show</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><b> Note: addLayoutComponent() is deprecated.</b>
<i>replaced by
      <code>addLayoutComponent(Component, Object)</code>.</i>
<p>
</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.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comp - the component to be removed.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#remove(java.awt.Component)">remove</a>, <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> parent)
</pre>
<dl>
  <dd> Determines the preferred size of the container argument using 
 this card layout.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the name of the parent container.
    <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#getPreferredSize">getPreferredSize</a>, <a href="#minimumLayoutSize">minimumLayoutSize</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> parent)
</pre>
<dl>
  <dd> Calculates the minimum size for the specified panel.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the name of the parent container
                in which to do the layout.
    <dt> <b>Returns:</b>
    <dd> the minimum dimensions required to lay out the
                subcomponents of the specified container.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#doLayout">doLayout</a>, <a href="#preferredLayoutSize">preferredLayoutSize</a>
  </dl></dd>
</dl>
<a name="maximumLayoutSize(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="maximumLayoutSize"><b>maximumLayoutSize</b></a>
<pre>
 public <a href="java.awt.Dimension.html#_top_">Dimension</a> maximumLayoutSize(<a href="java.awt.Container.html#_top_">Container</a> target)
</pre>
<dl>
  <dd> Returns the maximum 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>See Also:</b>
    <dd> <a href="java.awt.Container.html#_top_">Container</a>, <a href="#minimumLayoutSize">minimumLayoutSize</a>, <a href="#preferredLayoutSize">preferredLayoutSize</a>
  </dl></dd>
</dl>
<a name="getLayoutAlignmentX(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLayoutAlignmentX"><b>getLayoutAlignmentX</b></a>
<pre>
 public float getLayoutAlignmentX(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Returns the alignment along the x axis.  This specifies how
 the component would like to be aligned relative to other 
 components.  The value should be a number between 0 and 1
 where 0 represents alignment along the origin, 1 is aligned
 the furthest away from the origin, 0.5 is centered, etc.
<p>
</dl>
<a name="getLayoutAlignmentY(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLayoutAlignmentY"><b>getLayoutAlignmentY</b></a>
<pre>
 public float getLayoutAlignmentY(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Returns the alignment along the y axis.  This specifies how
 the component would like to be aligned relative to other 
 components.  The value should be a number between 0 and 1
 where 0 represents alignment along the origin, 1 is aligned
 the furthest away from the origin, 0.5 is centered, etc.
<p>
</dl>
<a name="invalidateLayout(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="invalidateLayout"><b>invalidateLayout</b></a>
<pre>
 public void invalidateLayout(<a href="java.awt.Container.html#_top_">Container</a> target)
</pre>
<dl>
  <dd> Invalidates the layout, indicating that if the layout manager
 has cached information it should be discarded.
<p>
</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> parent)
</pre>
<dl>
  <dd> Lays out the specified container using this card layout. 
 <p>
 Each component in the <code>parent</code> container is reshaped 
 to be the size of the container, minus space for surrounding 
 insets, horizontal gaps, and vertical gaps.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the name of the parent container
                             in which to do the layout.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Container.html#doLayout">doLayout</a>
  </dl></dd>
</dl>
<a name="first(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="first"><b>first</b></a>
<pre>
 public void first(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Flips to the first card of the container.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the name of the parent container
                          in which to do the layout.
    <dt> <b>See Also:</b>
    <dd> <a href="#last">last</a>
  </dl></dd>
</dl>
<a name="next(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="next"><b>next</b></a>
<pre>
 public void next(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Flips to the next card of the specified container. If the 
 currently visible card is the last one, this method flips to the 
 first card in the layout.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the name of the parent container
                          in which to do the layout.
    <dt> <b>See Also:</b>
    <dd> <a href="#previous">previous</a>
  </dl></dd>
</dl>
<a name="previous(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="previous"><b>previous</b></a>
<pre>
 public void previous(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Flips to the previous card of the specified container. If the 
 currently visible card is the first one, this method flips to the 
 last card in the layout.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the name of the parent container
                          in which to do the layout.
    <dt> <b>See Also:</b>
    <dd> <a href="#next">next</a>
  </dl></dd>
</dl>
<a name="last(java.awt.Container)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="last"><b>last</b></a>
<pre>
 public void last(<a href="java.awt.Container.html#_top_">Container</a> parent)
</pre>
<dl>
  <dd> Flips to the last card of the container.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the name of the parent container
                          in which to do the layout.
    <dt> <b>See Also:</b>
    <dd> <a href="#first">first</a>
  </dl></dd>
</dl>
<a name="show(java.awt.Container, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="show"><b>show</b></a>
<pre>
 public void show(<a href="java.awt.Container.html#_top_">Container</a> parent,
                  <a href="java.lang.String.html#_top_">String</a> name)
</pre>
<dl>
  <dd> Flips to the component that was added to this layout with the  
 specified <code>name</code>, using <code>addLayoutComponent</code>.  
 If no such component exists, then nothing happens.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> parent - the name of the parent container
                     in which to do the layout.
    <dd> name - the component name.
    <dt> <b>See Also:</b>
    <dd> <a href="#addLayoutComponent(java.awt.Component, java.lang.Object)">addLayoutComponent</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 the state of this card layout.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of this card 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.Canvas.html#_top_">Previous</a>  <a href="java.awt.Checkbox.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
