I want to change the look of a JButton when its pressed. Instead of making the background dark gray (default), I want it to be blue. I looked at this post, and saw that it uses JButton.setPressedIcon(Icon image) - Making Image button look pressed/clicked in Swing
I don't want to change the image. I only want to change the background color to non-default value when the button is pressed.
How can I do this ? Is it possible to do it without any overriding or creating a new class ?