src/java.desktop/share/classes/java/awt/ScrollPane.java

Print this page

        

@@ -742,14 +742,16 @@
             }
 
             Component c = scroller.getComponent(0);
             switch(adj.getOrientation()) {
             case Adjustable.VERTICAL:
-                c.move(c.getLocation().x, -(value));
+                c.move(c.getLocation().x,
+                        -(value) + ScrollPane.this.getInsets().top);
                 break;
             case Adjustable.HORIZONTAL:
-                c.move(-(value), c.getLocation().y);
+                c.move(-(value) + ScrollPane.this.getInsets().left,
+                        c.getLocation().y);
                 break;
             default:
                 throw new IllegalArgumentException("Illegal adjustable orientation");
             }
         }