Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6495530

MouseEvent.isAltDown() returns true when middle mouse pressed

    XMLWordPrintable

    Details

    • Subcomponent:
    • Understanding:
      Fix Understood
    • CPU:
      x86
    • OS:
      windows_2000

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"
      Java(TM) SE Runtime Environment (build 1.6.0-rc-b103)
      Java HotSpot(TM) Client VM (build 1.6.0-rc-b103, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      MouseEvent.isAltDown() returns true when middle mouse button is pressed

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Attach MouseListener, print result of isAltDown() when mouse button pressed. Press middle mouse button WITHOUT holding the Alt-key down. true is returned.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Method should reflect the state of the Alt-key.
      ACTUAL -
      Returns always true when middle button is pressed.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;


      public class Test
      {
      public static void main(String ... args)
      {
      try
      {
      JFrame frame = new JFrame();
      frame.getContentPane().addMouseListener(new MouseAdapter()
      {
      public void mousePressed(MouseEvent e)
      {
      System.out.print(e.isAltDown());
      }
      });
      frame.setSize(800,600);
      frame.setVisible(true);
      }
      catch(Exception e)
      {
      e.printStackTrace();
      }
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Unknown.

        Attachments

          Activity

            People

            Assignee:
            dav Andrei Dmitriev (Inactive)
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: