if (slider.getOrientation() == JSlider.HORIZONTAL) thumbRect.y = trackRect.y; else thumbRect.x = trackRect.x;
  protected void calculateThumbSize()  {    Dimension d = getThumbSize();    thumbRect.width = d.width;    thumbRect.height = d.height;    if (slider.getOrientation() == JSlider.HORIZONTAL)      thumbRect.y = trackRect.y;    else      thumbRect.x = trackRect.x;  }