Answer the question
In order to leave comments, you need to log in
How to turn off blue highlight on background when JButton is clicked in Windows?
Actually there is an application implemented in Java using Swing. When the status is "pressed" JButton in Windows is highlighted in blue. How to avoid this annoying moment?
The setContentAreaFilled(false) method removes borders, highlighting when pressed
The setBounds() method sets borders, no highlighting
Using all together results in a non-working button.
The setFocusPainted() setFocusable() methods
remove the focus in the false position, this is not necessary. Why did so many people recommend it?
Button at rest:
Pressed:
LAF knowledge is not sufficient to solve this problem on its own.
There is no solution as such on stackoverflow.com .
The setBackground method is being used. The blue color is superimposed on the base against all odds.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question