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

java.awt.TextArea doesn't wheel scroll horizontally on win32

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • beta2
    • x86
    • windows_nt

      The following test demonstrates two problems with wheel scrolling of TextAreas under Win32:

      * Frame1 has both scrollbars enabled, but text such that only the horizontal scrollbar is necessary. The mouse wheel should scroll the text horizontally, but does nothing.

      * Frame 2 only has the horizontal scrollbar enabled. Again, the mouse wheel should scroll the text horizontally, but it actually scrolls diagonally - BOTH HORIZONTALLY AND VERTICALLY.

      Both of these behaviors are clearly wrong, and easily reproducible. They could be bugs in Windows itself. I don't believe these problem exist with Linux mousewheel.

      import java.awt.*;

      public class HorizTextAreaScroll {
          public static void main(String[] args) {
              Frame f = new Frame("Frame 1 - both");
              TextArea ta = new TextArea();
              ta.append("A very, very, very, very, very, very, very, very, very, very, very, very, very, long line of text\n");
              ta.append("Another very, very, very, very, very, very, very, very, very, very, very, very, very, long line of text\n");
              f.add(ta);
              f.setSize(200, 200);
              f.show();

              Frame f2 = new Frame("Frame 2 - horizontal only");
              TextArea ta2 = new TextArea("", 0, 0, TextArea.SCROLLBARS_HORIZONTAL_ONLY);
              for (int i = 0; i < 9; i++) {
                  for (int j = 0; j < 50; j++) {
                     ta2.append("" + i + "");
                  }
                 ta2.append("\n");
              }
              f2.add(ta2);
              f2.setSize(225, 225);
              f2.setLocation(100, 100);
              f2.show();
          }
      }

            bchristi Brent Christian
            bchristi Brent Christian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: