I have a working code that captures mouse events in a JPanel. I need
clicked, released, and dragged events. The code works like a charm on
Linux. Occasionally in Windows I'm getting both dragged and clicked
events for a single mouse action. When I press and release the mouse
button I should get either a click event or a drag event, not both.
Below is some output to prove what I'm sometimes getting on Windows.
Look how far the mouse is moved but I'm still getting a click event. I'm
using 1.4.2 on Linux and Windows. Any ideas about this bug?
Thanks,
Chris
mousePressed
mouseDragged X:316 Y:51
mouseReleased
mouseClicked X:316 Y:51
-----------------------
mousePressed
mouseDragged X:116 Y:73
mouseDragged X:116 Y:74
mouseDragged X:117 Y:74
mouseReleased
mouseClicked X:117 Y:74
-----------------------
mousePressed
mouseDragged X:83 Y:82
mouseDragged X:83 Y:83
mouseDragged X:84 Y:83
mouseDragged X:85 Y:83
mouseDragged X:86 Y:83
mouseDragged X:86 Y:84
mouseReleased
mouseClicked X:86 Y:84
----------------------
Alex Molochnikov - 06 Apr 2004 08:04 GMT
Back in June 2003 I reported a somewhat similar problem with 1.4.2 Win.
(4874092 in Bugs Database). In my case, too, the code worked fine in 1.4.1
Win, and 1.4.2 Linux - but not in 1.4.2 Win. Sun's verdict was: there is a
bug, it will be (is?) fixed in 1.5 - but 1.4.2 will not be fixed.
SOL
> I have a working code that captures mouse events in a JPanel. I need
> clicked, released, and dragged events. The code works like a charm on
[quoted text clipped - 30 lines]
> mouseClicked X:86 Y:84
> ----------------------