Under certain circumstances, I need a JTabbedPane to remain on one pane until the user supplies certain information. Essentially, when this circumstance occurs, I need the current pane to become modal.
How can I implement this? I was thinking I could catch whatever event is triggered when the pane changes, and reset back to the pane I want to stick on. But I'm worried that this won't be quite right, that depending on when the event actually fires the transition to the new pane will happen after I call the method to set the pane to the pane I want, or some other similar race condition. Is there a better way? Is there a way I can make this approach work?
I would suggest setting the other tabs to disabled. This has a positive effect of providing the user feedback that they cannot click out of the tab. Otherwise they may be madly clicking and wondering why it will not let them leave the tab.
Simply set them enabled again after the required fields are completed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With