Results 1 to 2 of 2
Thread: Glow button
- 10-02-2010, 08:05 AM #1Member
- Join Date
- Aug 2010
- Rep Power
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.
- 10-02-2010, 12:00 PM #2
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.
- By Zack in forum Suggestions & FeedbackReplies: 0Last Post: 07-28-2010, 08:40 AM
- By happy_hippie in forum Java 2DReplies: 0Last Post: 04-22-2010, 06:48 AM
- By Tb0h in forum New To JavaReplies: 6Last Post: 07-22-2009, 01:28 AM
- By Java Tip in forum Java TipReplies: 0Last Post: 01-08-2008, 09:05 AM