This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
You can add a ChangeListener to listen to changes that have already happened, but as far as I know there's no way to block changing the selected tab. You can of course change back to the first tab instead.
Rob Spoor wrote:as far as I know there's no way to block changing the selected tab.
The selection takes place in the JTabbedPane's model. To repeat what I said on another forum in respect of unusual requirements for selection in a JList, weird selection behavior requires an equally weird selection model.