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

We need the Scroll Pad to behave like the Mouse Wheel.

    XMLWordPrintable

    Details

    • Type: Enhancement
    • 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:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
      Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]


      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Tested on a Compaq Presario 2538 Laptop with Windows XP Home Edition


      A DESCRIPTION OF THE PROBLEM :
      Most laptops today have a track pad instead of mouse, but the software treats
      a trackpad identically as a mouse, so this is no problem. Some mice have a
      mouse wheel, which is used only for vertical scrolling, and is supported by
      java. However, most new laptops have a "scroll pad" at the right of the track
      pad. It behaves exactly like the mouse wheel, in that it is only used for
      vertical scrolling. So it should be treated in software as a mouse wheel. But
      it doesn't work in Java. In fact, it works in all applications except java
      applications. The enclosed application shows that scroll pads behave incorrectly
      in the AWT, and they don't work at all in Swing.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the enclosed program on a Laptop that includes a scroll pad next to its
      touch pad. Follow the directions on screen.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      When the mouse pointer is inside a scrolling pane, the scroll pad may be used
      to scroll the pane vertically. The scrolling pane should move whenever your
      finger moves, and should stop when your finger stops. It shouldn't depend on
      whether or not the scrolling pane has the focus, unless the focus is inside a
      scrolling pane that is inside another scrolling pane.

      ACTUAL -
      In the AWT TextArea, it works incorrectly and erratically. First of all, it
      only works when the scrolling pane has the focus, regardless of where the mouse
      pointer is. As for the scrolling, I've seen two different behaviors with the
      same test case on the same laptop:
      Behavior1: It only handles the beginning of the scroll. If you drag slowly up
      or down the scroll pad, the scroll bar moves briefly at first, then stops
      moving. If you stop moving your finger but don't lift it, then after a
      brief delay the scroll bar will snap to a new position.
      Behavior 2: It doesn't scroll until you remove your finger. When you do, it
      only scrolls a single line.
      In the Swing JTextArea, the scroll pad doesn't work at all.

      (I haven't tried this with a mouse wheel, so I don't know if that has any of the same problems or not.)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.BorderLayout;
      import java.awt.GridLayout;
      import java.awt.TextArea;

      import javax.swing.JFrame;
      import javax.swing.JPanel;
      import javax.swing.JTextArea;
      import javax.swing.JScrollPane;

      public class ScrollPadBug
          extends JPanel
      {
      private static JFrame mf;

      public static void main(String[] args)
      {
      mf=new JFrame("ScrollPadBug");
      ScrollPadBug view=new ScrollPadBug();
      mf.getContentPane().setLayout(new BorderLayout());
      mf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      mf.getContentPane().add(view, BorderLayout.CENTER);
      mf.setBounds(10, 10, 600, 400);
      mf.setVisible(true);
      }

      private ScrollPadBug()
      {
      super(new GridLayout());
      String data = "\nAlpha\nBravo\nCharlie\nDelta\nEcho\nFoxtrot\nGolf\nHotel"
      + "\nIndia\nJuliet\nKilo\nLima\nMike\nNovember\nOscar\nPapa\nQuebec"
      + "\nRomeo\nSierra\nTango\nUniform\nVictor\nWhiskey\nX-ray\nYankee\nZulu";
      String awtTxt = "This is an awt TextArea. Click into this field and try the scroll pad."
      + "\nWhen you drag slowly, you'll see that only the beginning of the drag has any effect. "
      + "Dragging the rest of the way does nothing.\n" + data + data;
      String swingTxt = "This is a Swing JTextArea. Click into this field and try the scroll pad. "
      + "You'll see that it doesn't work at all.\n" + data + data;
      TextArea txt = new TextArea(awtTxt, 10, 10, TextArea.SCROLLBARS_VERTICAL_ONLY);
      txt.setText(awtTxt);
      add(txt);
      JTextArea jtxt = new JTextArea(10, 10);
      jtxt.setText(swingTxt);
      jtxt.setLineWrap(true);
      jtxt.setWrapStyleWord(true);
      JScrollPane scr = new JScrollPane(jtxt);
      scr.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
      scr.setVerticalScrollBarPolicy(scr.VERTICAL_SCROLLBAR_ALWAYS);
      add(scr);
      }
      }

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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Imported:
              Indexed: