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

MouseWheelEvent.getScrollAmount() does not reflect system setting on KDE Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      FULL PRODUCT VERSION :
      java version "1.4.2_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
      Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux SuSE-9.3: 2.6.11.4-20a-smp #1 SMP Wed Mar 23 21:52:37 UTC 2005 x86_64 x86_64 x86_64 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      KDE 3.4

      A DESCRIPTION OF THE PROBLEM :
      Although the KDE window manager on Linux provides a means through the Control Center to change the number of lines that the mouse wheel scrolls per click, this value is not reflected in the return value for MouseWheelEvent.getScrollAmount(), as it is on Windows.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Start up KDE.
      2. Navigate to the Control Center.
      3. Click on "Peripherals" in the tree view under the "Index" tab.
      4. Click on "Mouse" in the tree view.
      5. Select the "Advanced" tab in the mouse controls.
      6. Notice the setting for "Mouse wheel scrolls by". Change it to something other than the default value (3).
      7. Run a Java program having the following:
        a. A Swing GUI.
        b. A MouseWheelListener attached to some Component in the GUI.
        c. The MouseWheelListener simply prints to the output the value returned by getScrollAmount().
      8. Scroll the mouse wheel on the aforementioned Component.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The value of getScrollAmount() should reflect the system setting for the amount to scroll.
      ACTUAL -
      getScrollAmount() always returns 3.

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      class ScrollAmountTest {
          public static void main(String args[]) {
              SwingUtilities.invokeLater(new Runnable() {
                  public void run() {
                      JFrame jf = new JFrame();
                      JPanel jp = new JPanel();
                      
                      jf.getContentPane().add(jp);
                      jp.addMouseWheelListener(new MouseWheelListener() {
                          public void mouseWheelMoved(MouseWheelEvent e) {
                              System.out.println(e.getScrollAmount());
                          }
                      });
                      
                      jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                      jf.setBounds(100, 100, 400, 300);
                      jf.setVisible(true);
                  }
              });
          }
      }
      ---------- END SOURCE ----------

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Imported:
              Indexed: