很简单的问题:新手请教,解决后给分
javac Animator.java
Note:Animator.java uses or overrides a deprecated API.
Note:Recompile with -deprecation for details.
这是什么错?解决方法是什么?
Animator.java清单如下:
import java.awt.*;
import java.util.Vector;
public class Animator extends java.applet.Applet implements Runnable {
Vector images;
int imgNumber;
int currentImage=1;
Thread thisThread;
public void init(){
//Read in the number of images in the animation
imgNumber = new Integer(getParameter("imgNumber")).intValue();
//Load the images
for (int x=0;x<imgNumber;x++){
Image img = getImage(getDocumentBase(),"images/img"+(x+1));
images.addElement(img);
}
}
public void paint(Graphics g){
g.drawImage((Image)images.elementAt(currentImage++),0,0,null);
currentImage%=imgNumber;
}
public void update(Graphics g){
paint(g);
}
public void start(){
thisThread = new Thread(this);
thisThread.start();
}
public void stop(){
thisThread.stop();
}
public void run(){
while(true){
try{
thisThread.sleep(100);
}
catch (Exception e){}
}
}
}