【分析解答题】
下面是一个Apple(程序,其功能是播放动画。要求根据给出的3幅图片设计1个动画。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。
注意:不改动程序的结构,不得增行或删行。
程序运行结果如下:

import jav
A、awt.*;
import jav
A、applet.*;
import jav
A、awt.image.*;
/*
<applet code="ex24_3.class" width=800 height=400 >
</applet>
*/
public class ex24_3 extendsApplet implements Runnable
Image[] images=new Image[4];
Image image;
int imgNumber=3;
int currentImage=0;
Thread thisThread;
public void init()
for (int x=0;x<imgNumber;x++)
images[x]= getImage(getCodeBase(),"img"+x+".gif");
image=images[0];
public void paint(Graphics g)
g.drawImage(image[0],0,0,null); public void update(Graphics g)
paint(g);
public void start()
thisThread = new Thread(this);
thisThreaD、start();
public void stop()
thisThreaD、stop();
thisThread=null;
public void run()
while(true)
currentImage++;
currentImage=imgNumber; image=images[imgNumber]; repaint();
try
thisThreaD、sleep(100);
catchException e)
ex24_3.html <HTML>
<HEAD>
<TITLE>ex24_3</TITLE>
</HEAD>
<BODY>
<applet code="ex24_3.class" width=800 height=400 >
</applet>
</BODY>
</HTML>