java.awt

Class CardLayout

  • java.lang.Object
    • java.awt.CardLayout
  • All Implemented Interfaces:
    LayoutManager, LayoutManager2, java.io.Serializable
    public class CardLayout extends java.lang.Object implements LayoutManager2, java.io.Serializable
    A CardLayout 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. The first component added to a CardLayout object is the visible component when the container is first displayed.

    The ordering of cards is determined by the container's own internal ordering of its component objects. CardLayout defines a set of methods that allow an application to flip through these cards sequentially, or to show a specified card. The addLayoutComponent(java.awt.Component, java.lang.Object) method can be used to associate a string identifier with a given card for fast random access.

    Since:
    JDK1.0
    See Also:
    Container, Serialized Form
    • Constructors 
      Constructor and Description
      Ordinary member indicator CardLayout Reveal DetailHide Detail
      Creates a new card layout with gaps of size zero.
      Ordinary member indicator CardLayout Reveal DetailHide Detail
      Creates a new card layout with the specified horizontal and vertical gaps.
    • Methods 
      Modifier and Type Method and Description
      Ordinary member indicator addLayoutComponent Reveal DetailHide Detail
      Adds the specified component to this card layout's internal table of names.
      Ordinary member indicator addLayoutComponent Reveal DetailHide Detail
      Deprecated replaced by addLayoutComponent(Component, Object).
      Ordinary member indicator first Reveal DetailHide Detail
      Flips to the first card of the container.
      Ordinary member indicator getHgap Reveal DetailHide Detail
      Gets the horizontal gap between components.
      Ordinary member indicator getLayoutAlignmentX Reveal DetailHide Detail
      Returns the alignment along the x axis.
      Ordinary member indicator getLayoutAlignmentY Reveal DetailHide Detail
      Returns the alignment along the y axis.
      Ordinary member indicator getVgap Reveal DetailHide Detail
      Gets the vertical gap between components.
      Ordinary member indicator invalidateLayout Reveal DetailHide Detail
      Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
      Ordinary member indicator last Reveal DetailHide Detail
      Flips to the last card of the container.
      Ordinary member indicator layoutContainer Reveal DetailHide Detail
      Lays out the specified container using this card layout.
      Ordinary member indicator maximumLayoutSize Reveal DetailHide Detail
      Returns the maximum dimensions for this layout given the components in the specified target container.
      Ordinary member indicator minimumLayoutSize Reveal DetailHide Detail
      Calculates the minimum size for the specified panel.
      Ordinary member indicator next Reveal DetailHide Detail
      Flips to the next card of the specified container.
      Ordinary member indicator preferredLayoutSize Reveal DetailHide Detail
      Determines the preferred size of the container argument using this card layout.
      Ordinary member indicator previous Reveal DetailHide Detail
      Flips to the previous card of the specified container.
      Ordinary member indicator removeLayoutComponent Reveal DetailHide Detail
      Removes the specified component from the layout.
      Ordinary member indicator setHgap Reveal DetailHide Detail
      Sets the horizontal gap between components.
      Ordinary member indicator setVgap Reveal DetailHide Detail
      Sets the vertical gap between components.
      Ordinary member indicator show Reveal DetailHide Detail
      Flips to the component that was added to this layout with the specified name, using addLayoutComponent.
      Overridden member indicator toString Reveal DetailHide Detail
      Returns a string representation of the state of this card layout.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge