code: public void setPosition(int pos) {
  		if (pos < 0 || pos >= number)
  			throw new IllegalArgumentException("Position " + pos + " out of range");
  		position = pos;
  		updateLocationDefinition(position);
  		forwardButton.setEnabled(position < number - 1);
  		backwardButton.setEnabled(position > 0);
  		if (panel.getParent()!=null) positionChanged();
  	}
docs: Sets the position of the viewer.
  @param pos the new position of the viewer
  @throws IllegalArgumentException if the position is not valid