Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JTabbedPane colors changing.

Status
Not open for further replies.

Targol

Technical User
Sep 13, 2002
908
0
0
FR
Hi all,

I have a little problem I couldn't solve by myself so if someone can help me...

I put a JTabbedPane in a Swing Application and could find how to change some of the colors of the pane :
- the selected tab title color,
- the background color behind the tabs titles

I tried almost every methods I found in API that are Color related :
Code:
Color c = new Color(33,30,25);       
setBackground(c);
setForeground(c);
setBackgroundAt(0, c);
setForegroundAt(0, c);

... but couldn't change these colors.
So If someone can help...


Water is not bad as long as it remains outside human body ;-)
 
Yes of course, I already have defined my custom component to display tab titles but could achieve to change the colors as listed in first message...

By the way, I found a way to change the selected tab background color.
I give it to you if it can help :
Code:
Color c = new Color(33,30,25);
UIManager.put("TabbedPane.selected",c);
SwingUtilities.updateComponentTreeUI(this);
Note : "this" in above code refers to the TabbedPane itself.

Still searching for the way to change the background behind the tab titles...


Water is not bad as long as it remains outside human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top