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

 
kate damond
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a JTabbed Pane with four tabs on it. The first three are quite straightforward, but the fourth one should be disabled at first, then be enabled when some event happens.
So, I initially set a property 'Enabled' fo false : this did nothing. Then I found a property called 'TabEnabled' which, when I set it to false, disables the tab. Great ! So, now, on actionperformed of som button or other, I want to set the TabEnabled property to true again. Alas, I can get at the relevant tab, and I can get at a setEnabled() method but nothing to do with TabEnabled.
So, sticking with just Enabled property and the setEnabled() method, I can't find any evidence of it doing anything ! The Tab is always available.
Any ideas ?
Kate
p.s I don't know why I've started appearing as a 'Ranch Hand' ... seems to imply that I know something - but I know nothing !
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kate,
First off, you have become a ranch hand because you have posted more than 30 posts. Congrats!
Second you should look at the JTabbedPane method setEnabledAt. The code below uses it in conjunction with the buttons above the TabbedPane.

Enjoy,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic