December 2002
Intermediate to advanced
1032 pages
21h 24m
English
CardLayout places components on top of each other like a deck of cards. Only one component will be visible at any given time. After the components are placed on the container, you must develop code to cycle through the given cards.
CardLayout is particularly good when you have an area that contains different components at different times. This gives you a way to manage many panels that need to share the same frame. You then will create a component that cycles the user through the components within the container. Figure 12.6 shows a sample of how CardLayout manages components.
With the introduction of JTabbedPane, CardLayout is not as useful as it ...
Read now
Unlock full access