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

the scrollbar ranges on win32 are off

XMLWordPrintable

    • x86
    • windows_95

      The scrollbar ranges on Windows seem to be off. Given the following
      range values: minimum = 0, maximum = 20, visible = 10... On Motif, the
      scrollbar value ranges from the minimum to maximum-visible, as documented in
      the Scrollbar.setValues() documentation. So, for the above values, the
      scrollbar value can be scrolled from 0 to 10. On Windows, with the same
      range, the scrollbar can only be scrolled from 0 to 1.

      Sample Code:

      import java.applet.Applet;
      import java.awt.BorderLayout;
      import java.awt.Scrollbar;
      import java.awt.event.AdjustmentEvent;
      import java.awt.event.AdjustmentListener;

      public class scrollBarBug extends Applet implements AdjustmentListener
      {
        public void init()
        {
          Scrollbar scrollbar = new Scrollbar(Scrollbar.VERTICAL,
            0, 10, 0, 20);

          // Just setting layout so scrollbar thumb will be big enough to use
          setLayout(new BorderLayout());
          add("East", scrollbar);

          scrollbar.addAdjustmentListener(this);
        }

        public void adjustmentValueChanged(AdjustmentEvent e)
        {
          System.out.println(e.paramString());
        }
      }

            xdengsunw Xianfa Deng (Inactive)
            rschiavisunw Richard Schiavi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: