I would simply use a List<String>
containing all the names of the components in the card layout, and a field containing the index of the currently displayed component.
To know if you're at the beginning, you would test if index == 0
. To know if you're at the last component, you would test if index == list.size() - 1
. To show the next component, you would use index++; layout.show(parent, list.get(index));
.