import java.awt.*;
import java.applet.Applet;
public class exp7 extends Applet implements Runnable {
   int frame=0;  //帧号初始化
   Image images[];  //图像数组
   int delay;  //延迟时间
   Thread thread;  //线程
   Dimension offDimension;
   Image offImage;
   Graphics offGraphics;
   MediaTracker tracker;  //跟踪图像装载   public void init() {
      String str;
      str=getParameter("fps");  //HTML参数, 显示速率
      int fps=(str!=null)?Integer.parseInt(str):10; 
                             //有参数把字符串转为整数, 无参数则取10
      delay=(fps>0)?(1000/fps):100; //计算延迟时间
      images=new Image[19];
      tracker=new MediaTracker(this);  //创建跟踪对象
      for (int i=1; i<=19; i++) {
         images[i-1]=getImage(getDocumentBase(), i+".jpg");
                             //装载动画所需的图像1.gif等到图像数组
         tracker.addImage(images[i-1],0);  //图像载入动作编号列入监控
      }
   }   public void start() {
      if (thread==null)
         thread=new Thread(this);  //创建新线程
      thread.start();  //启动新线程
   }   public void run() {
      long startTime=System.currentTimeMillis();  //记下循环开始时间
      while (Thread.currentThread()==thread) {
         repaint();  //循环则重画画面
         try {
           startTime+=delay;  //开始时间加延迟时间
            thread.sleep(Math.max(0,startTime-System.currentTimeMillis()));
                             //睡眠时间不长于规定延迟时间
         } catch (InterruptedException e) {
            break;
         }  //异常处理
         frame++;  //当前帧号加1
      }
}   public void paint(Graphics g) {
      if (offImage!=null)
         g.drawImage(offImage,0,0,this);  //显示后台图像
      update(g);  //更新前台图像
   }   public void update(Graphics g) {
      Dimension d=size();  //返回当前图像大小
      if ((offGraphics==null)||(d.width!=offDimension.width)||
                              (d.height!=offDimension.height)) {
         offDimension=d;  //令缓冲区大小等于当前图像大小
         offImage=createImage(d.width, d.height);  //产生缓冲画面
         offGraphics=offImage.getGraphics();  //产生前台绘画区域
      }
      offGraphics.setColor(getBackground());
      offGraphics.fillRect(0, 0, d.width, d.height);  //抹去前台旧画面
      if(tracker.statusID(0, true)==MediaTracker.COMPLETE)
         offGraphics.drawImage(images[frame%10], 0, 0, this);
                                      //若图像装载完毕, 画到前台
      g.drawImage(offImage, 0, 0, this);  //切换前后台显示图像
   }   public boolean mouseDown(Event e, int x, int y) {
      if (thread==null)
         start();  //启动线程
      else thread=null;  //停止线程
      return false;  //事件上传
   }   public void stop() {
      thread=null;  //停止线程
      offImage=null;  //释放资源
      offGraphics=null;
   }
}我的图片组里有19张图片,为什么到动画播放的时候只播放前面的10张啊,后面的都不播了,直接就是前面十张循环。所有图片是在同一个文件夹里,而且命名是1.jpg,2.jpg,3.jpg,4.jpg,5.jpg..........19.jpg