int unit = direction * (slider.getMaximum() - slider.getMinimum()) / 10;  int moveTo = slider.getValue() + unit;
int unit = (slider.getMaximum() - slider.getMinimum()) / 10; int moveTo = slider.getValue(); if (direction > 0) moveTo += unit; else moveTo -= unit;
  public void scrollByBlock(int direction)  {    // The direction is -1 for backwards and 1 for forwards.    int unit = direction * (slider.getMaximum() - slider.getMinimum()) / 10;    int moveTo = slider.getValue() + unit;    if (slider.getSnapToTicks())      moveTo = findClosestTick(moveTo);    slider.setValue(moveTo);  }