Ood
Ood

Reputation: 1795

Is it Possible to Remove the Shadow on a JButton Icon?

My questing is pretty much already asked in the title. When you click a (Java Swing) JButton you get a type of hover effect or a "shadow" over the icon of the JButton. Is it possible to remove this shadow to make the button icon appear in the same way as it does when not clicked?

Thanks in advance!

Upvotes: 1

Views: 1357

Answers (2)

Zach
Zach

Reputation: 4792

You can try button.setBorder(null); This will remove all of the graphics for the button and therefore the button will look the same whether it has been pressed or not.

Upvotes: 0

NESPowerGlove
NESPowerGlove

Reputation: 5496

You could call setRolloverIcon with the result of getIcon.

Upvotes: 4

Related Questions