-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b08
-
x86
-
linux
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux xxxx 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Because of bitfield definitions in InputEvent, when e.g. CTRL-ALT-left mouse click occurs, SwingUtilities.isMiddleMouseButton returns true, which is inappropriate.
Likewise when Meta+left mouse is clicked, the event may be falsely reported as right button event by SwingUtilities.isRightMouseButton.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
attach MouseListener to a swing component
hold ctrl+alt keys and left-click some swing component. in listener.mouseClicked() observe the value of SwingUtilities.isMiddleMouseButton().
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
SwingUtilities.isMiddleMouseButton() should return false (left button was clicked)
ACTUAL -
SwingUtilities.isMiddleMouseButton() should returns true
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Calling code must not use SwingUtilities, but directly check by event.getButton() == BUTTON2. Effectively renders the SwingUtilities methods unusable (they are unreliable).
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux xxxx 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Because of bitfield definitions in InputEvent, when e.g. CTRL-ALT-left mouse click occurs, SwingUtilities.isMiddleMouseButton returns true, which is inappropriate.
Likewise when Meta+left mouse is clicked, the event may be falsely reported as right button event by SwingUtilities.isRightMouseButton.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
attach MouseListener to a swing component
hold ctrl+alt keys and left-click some swing component. in listener.mouseClicked() observe the value of SwingUtilities.isMiddleMouseButton().
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
SwingUtilities.isMiddleMouseButton() should return false (left button was clicked)
ACTUAL -
SwingUtilities.isMiddleMouseButton() should returns true
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Calling code must not use SwingUtilities, but directly check by event.getButton() == BUTTON2. Effectively renders the SwingUtilities methods unusable (they are unreliable).
- relates to
-
JDK-7146377 closed/javax/swing/DataTransfer/4876520/bug4876520.java failed since b08 in jdk 8
-
- Closed
-
-
JDK-7109991 SwingUtilities.isXMouseButton behaves unexpectedly starting from JDK8 b08
-
- Closed
-