This layout contains multiple panels, each fit to the container, where only a single panel can be visible at any given time. This layout style is most commonly used for wizards, tab implementations, etc.
The CardLayout's focal method is setActiveItem. Since only one panel is displayed at a time, the only way to move from one panel to the next is by calling setActiveItem, passing the id or index of the next panel to display. The layout itself does not provide a mechanism for handling this navigation, so that functionality must be provided by the developer.
@author Sanjiv JivanCardLayout
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 {@link CardLayout#addLayoutComponent}method can be used to associate a string identifier with a given card for fast random access.
@version 1.42 03/28/06
@author Arthur van Hoff
@see java.awt.Container
@since JDK1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|