java.awt
public class CardLayout extends Object implements LayoutManager2, Serializable
| Constructor Summary | |
|---|---|
| CardLayout()
Initializes a new instance of CardLayout with horizontal
and vertical gaps of 0. | |
| CardLayout(int hgap, int vgap)
Create a new CardLayout object with the specified
horizontal and vertical gaps.
| |
| Method Summary | |
|---|---|
| void | addLayoutComponent(Component comp, Object constraints)
Add a new component to the layout. |
| void | addLayoutComponent(String name, Component comp)
Add a new component to the layout. |
| void | first(Container parent)
Cause the first component in the container to be displayed.
|
| int | getHgap()
Return this layout manager's horizontal gap.
|
| float | getLayoutAlignmentX(Container parent)
Return this layout manager's x alignment. |
| float | getLayoutAlignmentY(Container parent)
Returns this layout manager's y alignment. |
| int | getVgap()
Return this layout manager's vertical gap.
|
| void | invalidateLayout(Container target)
Invalidate this layout manager's state. |
| void | last(Container parent)
Cause the last component in the container to be displayed.
|
| void | layoutContainer(Container parent)
Lays out the container. |
| Dimension | maximumLayoutSize(Container target)
Get the maximum layout size of the container.
|
| Dimension | minimumLayoutSize(Container target)
Get the minimum layout size of the container.
|
| void | next(Container parent)
Cause the next component in the container to be displayed. |
| Dimension | preferredLayoutSize(Container parent)
Get the preferred layout size of the container.
|
| void | previous(Container parent)
Cause the previous component in the container to be displayed.
|
| void | removeLayoutComponent(Component comp)
Remove the indicated component from this layout manager.
|
| void | setHgap(int hgap)
Set this layout manager's horizontal gap.
|
| void | setVgap(int vgap)
Set this layout manager's vertical gap.
|
| void | show(Container parent, String name)
Cause the named component to be shown. |
| String | toString()
Returns a string representation of this layout manager.
|
CardLayout with horizontal
and vertical gaps of 0.CardLayout object with the specified
horizontal and vertical gaps.
Parameters: hgap The horizontal gap vgap The vertical gap
Parameters: comp The component to add constraints The name by which the component can later be called
Throws: IllegalArgumentException If `constraints' is not a
String
Deprecated: This method is deprecated in favor of
addLayoutComponent(Component, Object).
Parameters: name The name by which the component can later be called comp The component to add
Parameters: parent The parent container, not null.
Returns: the horizontal gap
Parameters: parent Container using this layout manager instance
Returns: the x-axis alignment
Parameters: parent Container using this layout manager instance
Returns: the y-axis alignment
Returns: the vertical gap
Parameters: parent The parent container, not null.
Parameters: parent The parent container.
Parameters: target The parent container
Returns: the maximum layout size
Parameters: target The parent container
Returns: the minimum layout size
Parameters: parent The parent container, not null.
Parameters: parent The parent container
Returns: the preferred layout size
Parameters: parent The parent container, not null.
Parameters: comp The component to remove
Parameters: hgap The new gap
Parameters: vgap The new gap
null, this method does nothing.
Parameters: parent The parent container, not null. name The name of the component to show
Returns: A string representation of this object.