This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Change the Color of Title of JTabbedPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Change the Color of Title of JTabbedPane" Watch "Change the Color of Title of JTabbedPane" New topic
Author

Change the Color of Title of JTabbedPane

Chinmay Kant
Greenhorn

Joined: Feb 04, 2008
Posts: 20
Assume there are many tabbed panes in a window.

If JtabbedPane is not active then change color of Title Bar of Tabbed Pane to gray, just like in eclipse,
If Active, the Color of the Title Bar of Tabbed Pane is Blue.

How can i achieve this Functionality??


Thanks and Regards,
Chinmay
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19684
    
  20

I checked the basic look&feel class for tabbed panes, and found the following color properties:
  • TabbedPane.light
  • TabbedPane.highlight
  • TabbedPane.shadow
  • TabbedPane.darkShadow
  • TabbedPane.focus
  • TabbedPane.selected
  • TabbedPane.selectedForeground
  • TabbedPane.contentAreaColor
  • TabbedPane.tabAreaBackground
  • control
  • You can set these as follows:

    Now I don't really know which of these properties you should change, but you can find out by testing.


    SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
    How To Ask Questions How To Answer Questions
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
     
    subject: Change the Color of Title of JTabbedPane