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

Toolkit.addAWTEventListener doesn't allow listen MOUSE_WHEEL_EVENT_MASK events, XP

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 6
    • client-libs
    • x86
    • windows

      Use the test case below to reproduce the problem.

      In this test we just add AWTEventListener to receive MOUSE_WHEEL_EVENT_MASK events. Uncomment Component.addMouseWheelListener to make sure that native events is coming.

      Reproducible on Windows XP.

      ===================== TEST CASE ============================

      import java.awt.*;
      import java.awt.event.*;
      import java.security.*;

      public class simple{
          public static final void main(String args[]){
              Frame frame = new Frame("frame");
              Button button = new Button("button");

              frame.setLayout(new FlowLayout());
              frame.add(button);
      /*
              button.addMouseWheelListener(new MouseAdapter(){
                      public void mouseWheelMoved(MouseWheelEvent e){
                          System.out.println(e);
                      }
                  });
      */
              Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
                      public void eventDispatched(AWTEvent e) {
                          System.out.println(e);
                      }
                  }, InputEvent.MOUSE_EVENT_MASK | InputEvent.MOUSE_MOTION_EVENT_MASK | InputEvent.MOUSE_WHEEL_EVENT_MASK);

              frame.setBounds(100,100,100,100);
              frame.setVisible(true);
          }
      }

            son Oleg Sukhodolsky (Inactive)
            dcherepanov Dmitry Cherepanov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: