1

I have a JTabbedPane with few tabs and I want to change color of border.

https://i.stack.imgur.com/0CeUr.png

for better understanding at what border I refer.

camickr
  • 321,443
  • 19
  • 166
  • 288
KunLun
  • 3,109
  • 3
  • 18
  • 65

1 Answers1

2

That is controlled by the UI. You might be able to customize the color for all instances of your tabbed pane by changing value found in the UIManager.

Check out UIManager Defaults. It lists all the default values for each Swing component.

You will need to change the value BEFORE you create your instance of the JTabbedPane.

Maybe you can use one of the following:

UIManager.put("TabbedPane.borderHightlightColor", new ColorUIResource( Color.RED ));
UIManager.put("TabbedPane.darkShadow", new ColorUIResource( Color.RED ));
camickr
  • 321,443
  • 19
  • 166
  • 288