Skip navigation links
oracle.javatools.ui
Class MouseHoverSupport
java.lang.Object
oracle.javatools.ui.MouseHoverSupport
-
public class MouseHoverSupport
- extends java.lang.Object
Support to fire events if the mouse pointer hovers over a Component for a certain duration. The pointer doesn't have to remain completely still to prompt the firing of a mouseHover MouseEvent, just fairly steady to cater for hand shake. The hovering timer will begin as the mouse moves inside the component, the timer will restart if the mouse moves too far from the original hover point. Once the event has fired, the hovering timer will restart again once the mouse pointer is moved within the component. The timer will stop if the pointer leaves the component bounds.
Field Summary |
int |
MOUSE_HOVERED
A arbitrary mouse event ID to indicate mouse hovered events. |
Constructor Summary |
MouseHoverSupport(java.awt.Component comp, int duration, boolean repeat)
Add hover support to a component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MOUSE_HOVERED
public final int MOUSE_HOVERED
- A arbitrary mouse event ID to indicate mouse hovered events.
- See Also:
- Constant Field Values
MouseHoverSupport
public MouseHoverSupport(java.awt.Component comp,
int duration,
boolean repeat)
- Add hover support to a component. A mouseHover event will be fired to all interested listeners once the mouse pointer remains (fairly) still over the component for the given amount of time.
- Parameters:
comp
- the component to monitor for hovers
duration
- the number of milliseconds after a hover event will fire
repeat
- if true the hover event will be fired every 'duration' that the mouse pointer continues to hover over the comp. If false only one event is fired per hover.
addMouseHoverListener
public void addMouseHoverListener(MouseHoverListener l)
removeMouseHoverListener
public void removeMouseHoverListener(MouseHoverListener l)
Skip navigation links
Copyright © 1997, 2013, Oracle. All rights reserved.