I have a JButton
that I would like to change the background color of to white. When using the Metal Look And Feel, I achieve the desired effect with setBackground
:
Unfortunately, the concept of "background color" is different when using the Windows LAF; the background color is the color drawn around the button:
I would like to use the Windows LAF, but allow the button color of this JButton
to be changed to white. How do I do this?
You'll have to decide if it's worth the effort, but you can always create youe own ButtonUI
, as shown in this example due to @mKorbel.