Results 1 to 2 of 2

Thread: Glow button

  1. #1
    nikunj is offline Member
    Join Date
    Aug 2010
    Rep Power

    Default Glow button

    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.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power


    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.


Similar Threads

  1. Tab button
    By Zack in forum Suggestions & Feedback
    Replies: 0
    Last Post: 07-28-2010, 09:40 AM
  2. Inner glow on Area (source code)
    By happy_hippie in forum Java 2D
    Replies: 0
    Last Post: 04-22-2010, 07:48 AM
  3. Button
    By Tb0h in forum New To Java
    Replies: 6
    Last Post: 07-22-2009, 02:28 AM
  4. Using SWT Button
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-08-2008, 10:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts