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

Scrollpane spews out error messages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.1
    • client-libs
    • None
    • sparc
    • solaris_2.5



      Name: mc57594 Date: 01/10/97


      "java.lang.IllegalArgumentException: adjustable value 539 not within legal
      bounds (0 .. 0)
              at java.awt.ScrollPaneAdjustable.setValue(ScrollPane.java)
              at
      sun.awt.motif.MScrollPanePeer.scrolledVertical(MScrollPanePeer.java:153)
              at java.lang.Thread.run(Thread.java)"
        is printed to stderr when trying to scroll vertically.

      Example:
      <<
      import java.awt.*;

      public class SPane extends ScrollPane {
        Panel ip;

        public SPane() {
          ip = new Panel();
          add(ip);
          int i;
          for (i=1;i<100;i++) {
            Button b = new Button("Button" + i);
            ip.add(b);
          }
        }

        void fixdim() {
          ip.resize(100,1000);
          ip.layout();
        }

        public void paint(Graphics g) {
          fixdim();
          super.paint(g);
        }
        
        public void layout() {
          Graphics g;
          g = getGraphics();
          if (g!=null) {
            paint(g);
            super.layout();
          }
        }

        public static void main(String[] args) {
          Frame f = new Frame("Test");
          f.add(new SPane());
          f.pack();
          f.show();
        }
      }

      >>

      ======================================================================

            Unassigned Unassigned
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: