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