[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

Mouse on top of a JButton

Ok I know this is an easy question. But....

I have a JButton. All I want to do is when the mouse is on top of the button, I want to popup a dialogBox, and when the mouse is outside the button, the dialogbox must be disposed. What is the event I have to trip for this?.
0
prain
Asked:
prain
  • 4
  • 3
2 Solutions
 
Mayank SAssociate Director - Product EngineeringCommented:
mouseEntered and mouseExited () events are the ones you need to use. Add a MouseListener to your button.

button.addMouseListener ( new MouseAdapter () {
  public void mouseEntered ( MouseEvent me )
  {
    // do your stuff
  }
  public void mouseExited ( MouseEvent me )
  {
    // do your stuff
  }
} ) ;
0
 
CEHJCommented:
prain, can you explain why i received no points, having given you the first correct answer?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Mayank SAssociate Director - Product EngineeringCommented:
Yes this should be a split.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Notified Venabili, o' HG ;-)
0
 
CEHJCommented:
Thanks m :-)
0
 
CEHJCommented:
:-)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now