vsb.setValue(vr.y, vr.height, 0, vs.height);
vsb.setValues(vr.y, vr.height, 0, vs.height);
        public void stateChanged(ChangeEvent event)        {          JScrollBar vsb = JScrollPane.this.getVerticalScrollBar();          JScrollBar hsb = JScrollPane.this.getHorizontalScrollBar();          JViewport vp = JScrollPane.this.getViewport();                    if (vp != null && event.getSource() == vp)            {              // if the viewport changed, we should update the VSB / HSB              // models according to the new vertical and horizontal sizes              Rectangle vr = vp.getViewRect();              Dimension vs = vp.getViewSize();              if (vsb != null                  && (vsb.getMinimum() != 0                      || vsb.getMaximum() != vs.height                      || vsb.getValue() != vr.y                      || vsb.getVisibleAmount() != vr.height))                  vsb.setValue(vr.y, vr.height, 0, vs.height);              if (hsb != null                  && (hsb.getMinimum() != 0                      || hsb.getMaximum() != vs.width                      || hsb.getValue() != vr.width                      || hsb.getVisibleAmount() != vr.height))                hsb.setValue(vr.x, vr.width, 0, vs.width);            }          else            {              // otherwise we got a change update from either the VSB or              // HSB model, and we need to update the viewport positions of              // both the main viewport and any row or column headers to              // match.              int xpos = 0;              int ypos = 0;                            if (vsb != null)                ypos = vsb.getValue();          if (hsb != null)                xpos = hsb.getValue();              Point pt = new Point(xpos, ypos);              if (vp != null                  && vp.getViewPosition() != pt)                vp.setViewPosition(pt);              pt.x = 0;              if (rowHeader != null                   && rowHeader.getViewPosition() != pt)                rowHeader.setViewPosition(pt);                            pt.x = xpos;              pt.y = 0;              if (columnHeader != null                   && columnHeader.getViewPosition() != pt)                columnHeader.setViewPosition(pt);            }        }