I am trying to make a program in which when i put my cursor over a JButton, it will glow and when i removed the cursor, it will stop glowing.
I know it can be done by setRollOver() method but i am not able to achieve that.
I made a program in which when cursor comes over JButton it image changed. Not able to make it glow. Please Help me.
1. Define 'glow' in graphical or programming terms. I can think of at least 3 simple interpretations and there could be an infinite variety of those.
2. JButton doesn't have any setRollover method. Programming is an exercise in precision. If you mean setRolloverIcon, write setRolloverIcon. It's possible that you may also mean setRolloverEnabled or setRolloverSelectedIcon, hard to be sure.
3. The rollover effect is coded in the UI delegate. For the default Metal LaF, that's MetalButtonUI. To change the rollover effect, study the code and write your own class derived from a suitable UI delegate. Before you start, be aware that this may not be a trivial task.