Jump to content
xisto Community
Sign in to follow this  
beeseven

Is It Possible To Disable A Jbutton and make its icon still have colors?

Recommended Posts

I'm making minesweeper so I have this big matrix of JButtons. I want to have it so that when you click the button is disabled and the ImageIcon is changed to whatever it should be, but when you disable a button it becomes grayscale so the pictures are hard to see/don't look like what they're supposed to.Is there a way to disable the button and keep the images colorful, or does anyone have any other ideas?(I've thought about just removing the ActionListener but that might get confusing to have blank buttons that do nothing. Maybe only disabling it if there's not a number or mine, but that might require a lot more code)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.