index++;
  protected Rectangle getBox(Rectangle r)  {    if (!progressBar.isIndeterminate())      return null;    //numFrames has to be an even number as defined by spec.    int iterations = numFrames / 2 + 1;    double boxDependent;    double boxIndependent;    if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)      {	Dimension dims = getPreferredInnerHorizontal();	boxDependent = (double) dims.width / iterations;	boxIndependent = dims.height;      }    else      {	Dimension dims = getPreferredInnerVertical();	boxDependent = (double) dims.height / iterations;	boxIndependent = dims.width;      }    Rectangle vr = new Rectangle();    SwingUtilities.calculateInnerArea(progressBar, vr);    int index = getAnimationIndex();    if (animationIndex > (numFrames + 1) / 2)      index = numFrames - getAnimationIndex();    if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)      {	r.x = vr.x + (int) (index * boxDependent);	r.y = vr.y;	r.width = (int) boxDependent;	r.height = (int) boxIndependent;      }    else      {	index++;	r.x = vr.x;	r.y = vr.height - (int) (index * boxDependent) + vr.y;	r.width = (int) boxIndependent;	r.height = (int) boxDependent;      }    return r;  }