Hello there, How can i clear the background color of a JButton which current background is blue? What is the RGB color code for the default button color? Thanks
Howdy Pardner. You could use getBackground to store the colour of the button before you change it to blue, then use setBackground(storedColor). I thought that there might have been a constant defined somewhere in the swing package for the default colour but I could not find one.
Actually, the background color could change based on the Look and Feel. You can use UIManager.getColor( "Button.background" ) to get the default background color of buttons in the current Look and Feel.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
New web page for Paul's Rocket Mass Heaters movies