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 ofcards.
The ordering of cards is determined by thecontainer\'s own internal ordering of its component objects. The CardLayout class manages two or more components (usually JPanel instances) that share the same display space. 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.