File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Android Security Essentials Live Lessons this week in the Android 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

Change the Color of Title of JTabbedPane

Chinmay Kant

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,
Rob Spoor

Joined: Oct 27, 2005
Posts: 19656

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
    It is sorta covered in the JavaRanch Style Guide.
    subject: Change the Color of Title of JTabbedPane
    Similar Threads
    Active Title Bar Color
    Action for JMenuItem
    swing tabbed pane alignment
    What is the simplest way to order this?
    close JTabbedPane