dragging = true;
    public void mouseDragged(MouseEvent e)    {      if (slider.isEnabled())        {      currentMouseX = e.getX();      currentMouseY = e.getY();      if (slider.getValueIsAdjusting())        {	  int value;	  if (slider.getOrientation() == JSlider.HORIZONTAL)	    value = valueForXPosition(currentMouseX) - offset;	  else	    value = valueForYPosition(currentMouseY) - offset;	  slider.setValue(value);        }    }    }