@Override
      public void paintNow(int frame, int totalFrames, int cycle) {
        int len = AnimatedIcon.this.icons.length;
        currentIconIndex = frame < 0 ? 0 : frame >= len ? len - 1 : frame;
        paintImmediately(0, 0, getWidth(), getHeight());
      }
@Override
      public void paintNow(int frame, int totalFrames, int cycle)