I'm using a JTabbedPane to hold each step in the wizard that I am building. Navigation between steps is doing using the Previous/Next buttons or by selecting a tab. The buttons decrement/increment the JTabbedPane's SelectedIndex.
I need to validate each step before proceeding to the next step. Essentially, I'm having difficulty determining which event to use. The StateChange event occurs too late. Which event do I need to observe?
Another irritation: when the wizard runs, it seems to save the state of the JTabbedPane's SelectedIndex (usually the last step's value), this value is then used to set the SelectedIndex the next time the wizard is run. The selectedIndex property in the designer hasn't change. Moreover, calling the setSelectedIndex() in the JPanel's contructor doesn't seem to have an effect on this. What am I missing?