JDK-7130140 : using horizontal scroll button on mouse causes a message to be printed on stdout
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: x86
  • Submitted: 2012-01-14
  • Updated: 2014-10-15
  • Resolved: 2012-02-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u76Fixed 8 b25Fixed
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux hp-elitebook 2.6.35-31-generic #63-Ubuntu SMP Mon Nov 28 19:29:10 UTC 2011 x86_64 GNU/Linux

Ubuntu 10.10

EXTRA RELEVANT SYSTEM CONFIGURATION :
Mouse used:
Microsoft IntelliMouse explorer 4.0 USB/PS2 compatible
connected to the USB 3.0 port

A DESCRIPTION OF THE PROBLEM :
When using mouse scrolling button with 'horizontal scrolling' feature, a message is printed 2 times on the standard output every time, the horizontal scroll button is pressed.
The message printed: "MEvent. CASE!"

This seems to be the relevant code:
jdk1.7.0_02/java/awt/event/MouseEvent.java
line 761 in the
public MouseEvent(Component source, int id, long when, int modifiers,
                      int x, int y, int xAbs, int yAbs,
                      int clickCount, boolean popupTrigger, int button)
method:

if (getModifiersEx() != 0) { //There is at least one more button in a pressed state.
                if (id == MouseEvent.MOUSE_RELEASED || id == MouseEvent.MOUSE_CLICKED){
                    System.out.println("MEvent. CASE!");
                    shouldExcludeButtonFromExtModifiers = true;
                }
            }

This was not an issue in older versions of JDK (at least in the 1.6.0.26)


REGRESSION.  Last worked in version 7

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
create a swing application and try to horizontal scroll above the window. Watch the standard output from the application

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Nothing is printed on the standard output
ACTUAL -
message "MEvent. CASE!" is printed on the standard output 2x for each 'button press'

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;

class Test extends JFrame {

    public static void main(String[] args) {
        Test test = new Test();
        test.setSize(200,200);
        test.setVisible(true);
        test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}

---------- END SOURCE ----------

SUPPORT :
YES

Comments
Verified b97!
10-07-2013

SUGGESTED FIX http://hg.openjdk.java.net/jdk8/awt/jdk/rev/19431d07bc19
23-01-2012

EVALUATION The debug output should be removed.
23-01-2012