Class java.awt.CardLayout
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.CardLayout

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

public class CardLayout
extends Object
implements LayoutManager
A layout manager for a container that contains several 'cards'. Only one card is visible at a time, allowing you to flip through the cards.

Constructor Index

 o CardLayout()
Creates a new card layout.
 o CardLayout(int, int)
Creates a card layout with the specified gaps.

Method Index

 o addLayoutComponent(String, Component)
Adds the specified component with the specified name to the layout.
 o first(Container)
Flip to the first card.
 o last(Container)
Flips to the last card of the specified container.
 o layoutContainer(Container)
Performs a layout in the specified panel.
 o minimumLayoutSize(Container)
Calculates the minimum size for the specified panel.
 o next(Container)
Flips to the next card of the specified container.
 o preferredLayoutSize(Container)
Calculates the preferred size for the specified panel.
 o previous(Container)
Flips to the previous card of the specified container.
 o removeLayoutComponent(Component)
Removes the specified component from the layout.
 o show(Container, String)
Flips to the specified component name in the specified container.
 o toString()
Returns the String representation of this CardLayout's values.

Constructors

 o CardLayout
  public CardLayout()
Creates a new card layout.
 o CardLayout
  public CardLayout(int hgap,
                    int vgap)
Creates a card layout with the specified gaps.
Parameters:
hgap - the horizontal gap
vgap - the vertical gap

Methods

 o addLayoutComponent
  public void addLayoutComponent(String name,
                                 Component comp)
Adds the specified component with the specified name to the layout.
Parameters:
name - the name of the component
comp - the component to be added
 o removeLayoutComponent
  public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.
Parameters:
comp - the component to be removed
 o preferredLayoutSize
  public Dimension preferredLayoutSize(Container parent)
Calculates the preferred size for the specified panel.
Parameters:
parent - the name of the parent container
Returns:
the dimensions of this panel.
See Also:
minimumLayoutSize
 o minimumLayoutSize
  public Dimension minimumLayoutSize(Container parent)
Calculates the minimum size for the specified panel.
Parameters:
parent - the name of the parent container
Returns:
the dimensions of this panel.
See Also:
preferredLayoutSize
 o layoutContainer
  public void layoutContainer(Container parent)
Performs a layout in the specified panel.
Parameters:
parent - the name of the parent container
 o first
  public void first(Container parent)
Flip to the first card.
Parameters:
parent - the name of the parent container
 o next
  public void next(Container parent)
Flips to the next card of the specified container.
Parameters:
parent - the name of the container
 o previous
  public void previous(Container parent)
Flips to the previous card of the specified container.
Parameters:
parent - the name of the parent container
 o last
  public void last(Container parent)
Flips to the last card of the specified container.
Parameters:
parent - the name of the parent container
 o show
  public void show(Container parent,
                   String name)
Flips to the specified component name in the specified container.
Parameters:
parent - the name of the parent container
name - the component name
 o toString
  public String toString()
Returns the String representation of this CardLayout's values.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index