Wizards have become common place (except the ones in Harry Potter); they allow us to complete complex tasks in simple intuitive steps and can be as simple as just a sequence of navigable steps or as complex as having steps dynamically added from an RPC call based on a selection in a previous step.
The good news is that CardLayout
can be used to build a basic wizard, devoid of all the bells and whistles that your imagination can conjure. CardLayout
renders the child components of a container such that only one component is fitted or visible (CardLayout
extends FitLayout)
in the container at a time. The only way to move from one child component to the next is by calling setActiveItem()
on the layout, giving it the component to display while the others stay hidden.
The drawback to this whole thing is that CardLayout
itself does not provide a mechanism for handling navigation between the components it is rendering, nor does the supposedly handy CardPanel...