Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTabbedPane

 
pankaj saxena
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 3 tabs in one frame:
1. write
2. changes
3. add

Question:
How would i make other tabs inaccessible, when the user is working on one tab (lets say, write tab), so that during the process, if that user clicks on another tabs, he wouldn't be allowed?


 
Bharath Raja
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pankaj saxena wrote:I have 3 tabs in one frame:
when the user is working on one tab (lets say, write tab), so that during the process, if that user clicks on another tabs, he wouldn't be allowed?


get the index of tabs(your changes tab and add tab) and you can disable that tabs using 'setEnabledAt(int index,boolean false/true)'
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of your duplicate threads on this subject have been sent to oblivion.

As for your question, if you're thinking about having tabbed panes with non-functional tabs, perhaps you don't want tabbed panes at all. Maybe CardLayout would be better.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic