Home » Java » Miscellaneous » DoubleClickDetector

 Advertisement
  • Visit:
  • Hits:
  • Views:
  • Platform(s):
  • Database(s):
  • License:
  • Price:
  • Version:
  • Script Added:
  • Last Updated:
  • Developer:
  • Script Link:
  • Tags:

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.

Rated 0/5 (0%) (0 Votes)
 Script Name: DoubleClickDetector
 Your Name:
 Your Email:
 Your Friends Name:
 Your Friends Email:
 Script Name : DoubleClickDetector
 Reason :
 Message :
  Security Code:
  •  Other listings by this developer
ListStack
Java » Miscellaneous

SortedList
Java » Miscellaneous

MovePath
Java » Development

Observer3D
Java » Development

DLList
Java » Development

SocketConnection
Java » Miscellaneous

ConcreteSet
Java » Miscellaneous