Remove the JTabbedPane "currently selected" dotted line
How do you remove the dotted line 开发者_运维知识库around the currently selected tab on a JTabbedPane.
For example:
See the dotted line around it?
I just found a better way:
component.setFocusable(false);
try setting the focus colour
UIManager.put("TabbedPane.focus", new Color(0, 0, 0, 0));
or set it to the same colour as the background
- This is painted by the current Look and Feel.
I believe what is needed will depend on the LnF you're using.
You'll want to create a custom TabbedPaneUI class, probably overriding the one in your chosen L&F. You might be overriding
javax.swing.plaf.basic.BasicTabbedPaneUI
.- override
paintFocusIndicator
, and make it an empty method. - You will need to create an instance of this class, then call
myTabbedPane.setUI(myTabbedPaneUI)
精彩评论