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

fp.bugs 3131 Scrollbar.set*Increment() works only after pack()

XMLWordPrintable

    • 1.1
    • x86, sparc
    • solaris_2.5, windows_95
    • Not verified

       >From: "Brian R. Hanson" <###@###.###>
      Mime-Version: 1.0
      To: java@java
      Subject: Bug in Scrollbar class
      X-Url: http://java.sun.com/intouch.html
      Content-Transfer-Encoding: 7bit

      The Scrollbar class ignores the setLineIncrement and setPageIncrement
      values unless it is done after addNotify is done.

      Within the code to Scrollbar.java, the setLineIncrement and
      setPageeIncrement calls only set the class variables if the peer has
      not been created. However, when the peer is created, it is not
      notified of these changed values.

      I have to assume that this is not the desired behaviour.

      -- Brian Hanson
      -- ###@###.###
      ____
      Jim Hagen( hagen@eng ) adds:
      I've created the following example of this. The two scrollbars are identical except for the fact that the first one has calls to setPageIncrement and setLineIncrement before pack() and the second has the identical calls after pack(). The first scrollbar uses default increment values. AWT component values like these ( which don't change the display of the component ) shouldn't be tied to pack(), should they?

      import java.awt.*;

      public class T3131 extends Frame
        {
        Panel panel;
        Scrollbar t,v;

        int windowWidth = 200;
        int windowHeight = 150;

        public T3131(String args[])
          {
          super("Bug Report 3131");

          panel = new Panel();
          t = new Scrollbar(Scrollbar.VERTICAL, 0, 10, 0, 10);
          v = new Scrollbar(Scrollbar.VERTICAL, 0, 10, 0, 10);
          panel.add(t);
          panel.add(v);
       
          add("South", panel);
       
          resize(windowWidth, windowHeight);
        t.setLineIncrement(5);
      t.setPageIncrement(10);
          pack();
        v.setLineIncrement(5);
      v.setPageIncrement(10);
         show();

          }


        public static void main(String args[])
          {
          new T3131(args);
          }
        }

            tballsunw Tom Ball (Inactive)
            bhagen Benjamin Hagen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: