1

I have a JTabbedPane with eight tabs. I have disabled one of the tabs using the code

 jtp.setEnabledAt(7, false);

My problem is that the tab label (just for the disabled tab) now has a dark grey background colour and I would like to change that. I tried the method setBackgroundAt but nothing happened. I checked the UIManagerDefaults (http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/) but found nothing there about the colour of a disabled tabbed pane. How can I change this colour? Thanks.

user3245747
  • 805
  • 2
  • 17
  • 30

1 Answers1

1

I found the solution to this problem. I used the CustomTabbedPaneUI class posted by mKorbel at this link: How can I change the shape of a JTabbedPane tab? I then modified the paintTabBackground method so that the background colour of a disabled tabbed pane is white.

Community
  • 1
  • 1
user3245747
  • 805
  • 2
  • 17
  • 30