U
U
Uvelir2014-04-13 00:09:45
Java
Uvelir, 2014-04-13 00:09:45

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:
1a34a80dc0384b4497275a76d69fa60b.JPG

Pressed:
f3aa0d5329544ae998f57bcc0f13fd94.jpg

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 question

Ask a Question

731 491 924 answers to any question