Changing the color of the Java Swing Component Focus indicator

I have a JPanel with JButton, JTextField, and JTable, and the TAB key intersects these components, as expected, with a small black box drawn around the component (or cell in the case of JTable) that has focus. How to change the color of the focus indicator of a black box?

+5
source share
1 answer

Appearance is controlled by each delegate of the user interface discussed in How to Customize Appearance and Perception .

As a concrete example, on some L & Fs you can override the default value when your program starts:

UIManager.put("Button.focus", Color.red);
+3
source

All Articles