Documentation

CardLayout

The card layout manager treats each component in the container as a card. Only one card is visible at a time. The container acts as a stack of cards. The first component added to a card layout is the visible component when the container is first displayed.

CardLayout is part of the standard Java distribution. The API documentation is available here.

Layout manager properties

A container with this layout manager has following layout manager properties:

Property Name Description Default
horizontal gap The horizontal gap at the left and right edges. 0
vertical gap The vertical gap at the top and bottom edges. 0

Layout constraints properties

A component contained in a container with this layout manager has following layout constraints properties:

Property Name Description
Card Name Identifier that can be used to make a card visible. See API documentation for CardLayout.show(Container, String).