Results 1 to 2 of 2

Thread: Glow button

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

    Default Glow button

    Hi,
    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 Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    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.

    db

Similar Threads

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