-
Bug
-
Resolution: Fixed
-
P3
-
1.4.2, 5.0
-
b38
-
x86
-
linux, windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2125768 | 5.0u5 | Denis Fokin | P3 | Resolved | Fixed | b03 |
FULL PRODUCT VERSION :
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux fuji 2.4.20 #2 SMP Tue May 13 19:03:46 CEST 2003 i686 unknown unknown GNU/Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
none
A DESCRIPTION OF THE PROBLEM :
A mouse click event is dispatched after a mouse press-drag-release sequence has occurred. No click event should be generated if the mouse is dragged between the press and release events.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and run the attached test case.
2. Click, drag and release the mouse in the window.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Mouse pressed
Mouse dragged
...
Mouse dragged
Mouse released
ACTUAL -
Mouse pressed
Mouse dragged
...
Mouse dragged
Mouse released
Mouse clicked
Note the unexpected click event at the end.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
none
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ExtraClickDemonstration extends JComponent {
public ExtraClickDemonstration() {
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
System.err.println("Mouse pressed");
}
public void mouseReleased(MouseEvent e) {
System.err.println("Mouse released");
}
public void mouseClicked(MouseEvent e) {
System.err.println("Mouse clicked");
}
});
addMouseMotionListener(new MouseMotionAdapter() {
public void mouseDragged(MouseEvent e) {
System.err.println("Mouse dragged");
}
});
}
public static void main(String[] args) {
JFrame frame = new JFrame("Extra Click Demonstration");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new ExtraClickDemonstration(), BorderLayout.CENTER);
frame.setSize(new Dimension(480, 300));
frame.setVisible(true);
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_04
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Incident Review ID: 260137)
======================================================================
- backported by
-
JDK-2125768 REGRESSION: Extra mouse click dispatched after press-drag- release sequence.
- Resolved
- relates to
-
JDK-4731797 Mouse click/drag zone is not read correctly from Win32
- Resolved
-
JDK-4955581 [Win] Caret is positioned incorrectly while using Chinese QuanPin Input Method
- Closed
-
JDK-6481521 Double click interval settings from DE not honored on Linux
- Closed
-
JDK-6404008 REGRESSION: Mouse dragged events obey drag sensitivity
- Resolved
-
JDK-6176814 Metalworks frame maximizes after the move
- Closed
-
JDK-6403381 REGRESSION: MouseDragged and DragGestureRecognized events' order is swapped.
- Closed
-
JDK-4974936 Metal PL&F, a PL&F decorated JFrame maximizes on release of a title bar drag
- Closed