{   if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; }
thumbRect.x = trackRect.x;
  protected void calculateThumbSize()  {    if (slider.getOrientation() == JSlider.HORIZONTAL)      {	if (thumbWidth > contentRect.width)	  thumbRect.width = contentRect.width / 4;	else	  thumbRect.width = thumbWidth;	if (thumbHeight > contentRect.height)	  thumbRect.height = contentRect.height;	else	  thumbRect.height = thumbHeight;      }    else      {	// The thumb gets flipped when inverted, so thumbWidth 	// actually is the height and vice versa.	if (thumbWidth > contentRect.height)	  thumbRect.height = contentRect.height / 4;	else	  thumbRect.height = thumbWidth;	if (thumbHeight > contentRect.width)	  thumbRect.width = contentRect.width;	else	  thumbRect.width = thumbHeight;      }  }