0

I'm trying to set the background color for a JTab. I can set it and see the new color if I am not on that particular tab. If I am on that tab I don't see the color. I think its because it overwrites the background color with the 'selected' color since we've selected that tab.

What can I do? Thank you very much!!

kleopatra
  • 51,061
  • 28
  • 99
  • 211
user565660
  • 1,171
  • 3
  • 20
  • 37

1 Answers1

1

If you are talking about the JTabbedPane:

UIManager.put("TabbedPane.selected", YOUR_COLOR)

Also see: Override default look and feel Java

Community
  • 1
  • 1
Jim
  • 3,476
  • 4
  • 23
  • 33
  • Does this take affect for that particular tab or all of the tabs? I want to it just for certain tabs. – user565660 Mar 02 '12 at 16:09
  • Setting the value in the UIManager will do it for the entire application. The link has another way to customize the entire app. For a single tab, you can call setUI on it and build your own UI painter: http://stackoverflow.com/questions/7859035/jtabbedpane-customize-tab-look, google around there's a lot of stuff out there about this idea. – Jim Mar 02 '12 at 21:41