if (value == scrollbar.getValue()) return;
    public void mousePressed(MouseEvent e)    {      currentMouseX = e.getX();      currentMouseY = e.getY();      int value;      if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL)	value = valueForXPosition(currentMouseX);      else	value = valueForYPosition(currentMouseY);      if (value == scrollbar.getValue())	return;      if (! thumbRect.contains(e.getPoint()))        {	  scrollTimer.stop();	  scrollListener.setScrollByBlock(true);	  if (value > scrollbar.getValue())	    {	      trackHighlight = INCREASE_HIGHLIGHT;	      scrollListener.setDirection(POSITIVE_SCROLL);	    }	  else	    {	      trackHighlight = DECREASE_HIGHLIGHT;	      scrollListener.setDirection(NEGATIVE_SCROLL);	    }	  scrollTimer.start();        }      else        {	  // We'd like to keep track of where the cursor	  // is inside the thumb.	  // This works because the scrollbar's value represents 	  // "lower" edge of the thumb. The value at which	  // the cursor is at must be greater or equal	  // to that value.	  scrollbar.setValueIsAdjusting(true);	  offset = value - scrollbar.getValue();	}      scrollbar.repaint();          }