Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the look of a disabled JButton in java

I am making a game and when I disable a button with setEnabled(false); the buttons turns 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?

like image 878
Patrick Avatar asked Oct 19 '09 19:10

Patrick


Video Answer


1 Answers

You can also set a disable icon with JButton.setDisableIcon()

like image 113
OscarRyz Avatar answered Sep 27 '22 19:09

OscarRyz