void scrollByUnits(JScrollBar scrollbar, int direction, int units) {
			// This method is called from BasicScrollPaneUI to implement wheel
			// scrolling, as well as from scrollByUnit().
			int delta;

			for (int i = 0; i < units; i++) {
				if (direction > 0) {
					delta = scrollbar.getUnitIncrement(direction);
				} else {
					delta = -scrollbar.getUnitIncrement(direction);
				}

				int oldValue = scrollbar.getValue();
				int newValue = oldValue + delta;

				// Check for overflow.
				if (delta > 0 && newValue < oldValue) {
					newValue = scrollbar.getMaximum();
				} else if (delta < 0 && newValue > oldValue) {
					newValue = scrollbar.getMinimum();
				}
				if (oldValue == newValue) {
					break;
				}
				scrollbar.setValue(newValue);
			}
		}