public class LoadingPicture extends Applet{
    Image image;
    public void init(){
       image = getImage(getCodeBase(),"3.gif");
    }
    public void paint(Graphics g){
        int w = image.getWidth(this);
        int h = image.getHeight(this);
        g.drawImage(image,w,h,this);
    }
}
但是在html中可以看见?

解决方案 »

  1.   

    appletviewer *.html(*.html为你执行的那个html);
      

  2.   

    我在web页面中,我生成的unit.class文件在depoly/Web-INF/classes文件夹中。我页面在depoly文件夹下面。html文件加载的unit.class文件只认depoly文件夹下面的unit.class文件,怎么不认depoly/Web-INF/classes文件下面的unit.class文件呢?我的codeBase=“http://localhost:8080”或者codeBase="/"都只认depoly下面的unit.class。请问为什么?