I am making a game and when I disable a button with setEnabled(false); the buttons turn grey which clashes with the other colors in the game. Is their a way to change the color of the button when it is disabled?
+1
A:
You'll want to modify the Look and Feel you are using. There are tons available for download and you can of course make your own.
Nick Veys
2009-10-19 20:01:32
A:
i am not 100% on this, but i think you can overwrite the paint method of the button's glasspane to overlay it with the color of your choice.
here is a tutorial on the panes of a container:
http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html
clamp
2009-10-19 20:18:09
Individual components don't have a glasspane. The glasspane is for the entire frame.
camickr
2009-10-19 20:21:48
+2
A:
If you are talking about the text, then you might be able to use the UIManager to change the disabled foreground color. Check out the UIManager Defaults.
camickr
2009-10-19 20:20:47