File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Dynamically change tab color JTabbedPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Dynamically change tab color JTabbedPane" Watch "Dynamically change tab color JTabbedPane" New topic
Author

Dynamically change tab color JTabbedPane

Fille Janssens
Greenhorn

Joined: Apr 10, 2006
Posts: 2
I want to change the tab backgroundcolor from black to red after the user has made a particular selection. I can set the black backgroundcolor at application start, but I'm unable to change the color after that.

Does anybody know how to achieve this?
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
This might be plaf–related if you're using win xp. See bug reports 5032785 and the related (via link) 4880747, esp. the evaluation sections.
Here's an exploratory test
Fille Janssens
Greenhorn

Joined: Apr 10, 2006
Posts: 2
It seems possible to change the tab background color using the setBackgroundAt() method with the jre 1.5. I got it working while using SuSe linux as well with Win XP sp2.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically change tab color JTabbedPane