Home » Java » Miscellaneous » DoubleClickDetector
- Visit:
- Hits:
- Views:
- Platform(s):
- Database(s):
- License:
- Price:
- Version:
- Script Added:
- Last Updated:
- Developer:
- Script Link:
- Tags:
- DoubleClickDetector
- 158
- 2861
- N/A
- N/A
- Other Not Free License
- Free
- 1.0.0
- 07/09/2011
- 07/09/2011
- Ralph Chapin
- http://www.binpress.com/app/doubleclickdet...
- awt click code count detector
Description:
A specialized mouse listener that detects and acts on double-clicks. Simply add it as a MouseListener to any component and add code to do the double-click work. It will react to a double click count even when the second click is not on the exact same pixel as the first click. It plays well with other mouse listeners, ignoring "consumed" mouse events and only consuming events when it actually does something.
(The movement of the mouse between the clicks of a double-click is what makes it so hard for some people to double-click with a mouse. Consuming ignored mouse clicks leads to users who are attempting several single-clicks in a row having to click twice for each plain single-click, or else clicking vveerryy sslloowwllyy.)
DoubleClickDetector is best used in a Swing or Awt environment as opposed to Graphics2D. Graphics, if at all interactive, usually requires an elaborate MouseListener implementation with plenty of instance fields and lots of code for each event type. But even with graphics, this code can serve as a proper example of how to handle a double-click.
DoubleClickDetector is fully Javadoc'ed and the source code includes a usage example.
- Other listings by this developer
Java » Miscellaneous
SortedList
Java » Miscellaneous
MovePath
Java » Development
Observer3D
Java » Development
DLList
Java » Development
SocketConnection
Java » Miscellaneous
ConcreteSet
Java » Miscellaneous