This week's giveaway is in the Testing forum. We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line! See this thread for details.
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.
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
Free, earth friendly heat - from the CodeRanch trailboss