Name: gm110360 Date: 12/05/2001 java version "1.4.0-rc" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b88) Java HotSpot(TM) Client VM (build 1.4.0-rc-b88, mixed mode) In Windows, users can setup the minimal interval between consecutive mouse clickes for those two clicks to be recognized as double click. Also in Windows, it's permissible to move mouse position slightly to some amount between two clicks constituting a double click. As far as I know, there's no clear indication in Java API documentation about how a programmer benefits from the platform specific double click detection. There should be a clear definition or a facility to capture this platform (maybe) platform specific events. I'm using mouse pressed / released instead of mouse clicked to detect double clicks since the current AWT implementation seems to convert Windows double click messages to mouse pressed / released events with click count of 2. (Review ID: 136785) ====================================================================== Name: gm110360 Date: 12/05/2001 java version "1.4.0-rc" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b88) Java HotSpot(TM) Client VM (build 1.4.0-rc-b88, mixed mode) Launch SwingSet2 and choose tree tab. When we double click on a node with children, it toggles between expanded and collapse states. In Windows, if we click more than twice without moving the mouse points, then the node keeps toggled. But in Swing, the toggling happens only once. This is caused by the difference in the recognization of double clicks in AWT and Windows. Windows detects double clicks done with slight mouse movement between two subsequent clicks, but Swing don't. Even though I report this as a bug specific to JTree, this discrepancy in double click detection is sometimes very annoying in most cases. So I usually utilizes a undocumented behavior that may be specific to the current AWT implementation, that is, I'm detecting double clicks by capturing mouse released or pressed events instead of mouse clicked, since the current AWT implementation takes Windows double click messages and transforms them to mouse released and pressed events with click count of 2. (Review ID: 136782) ======================================================================
|