• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JTabbedPane

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic