别用 MS 的东西了
引用某虾的话
M$ 的 Jvm 非正规的 Java 血统 !

解决方案 »

  1.   

    但是决大多数机子都不会装java运行环境啊,这也是为什么我只用到java1.0 1.1的类,就是怕微软的东西不支持。谁能告诉我谁能告诉我~!!!!我在别人没装运行环境的机子上,能访问到我机子上运行有applet 的weblogic console,但是我的却不行,一定是哪里出错了。
      

  2.   

    import java.awt.*;
    import java.util.Vector;public class Animator extends java.applet.Applet implements Runnable
    {
    Vector images=new Vector();
    int imgNumber;
    int currentImage=0;
    Thread thisThread;

    public void init(/*Graphics g*/)
    {
    imgNumber=new Integer(getParameter("imgNumber")).intValue();
    //g.drawString("init proc started",10,10);

    for(int x=0;x<imgNumber;x++)
    {
    Image img=getImage(getCodeBase(),"images/img"+(x+1)+".gif");
    images.addElement(img);
    }
    //resize(100,100);
    }

    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)
    {
    repaint();
    try{
    thisThread.sleep(1000);
    }
    catch(Exception e){}
    }
    }
    }
      

  3.   

    <HTML>
    <TITLE>animator</TITLE>
    <BODY>
    <APPLET CODE="Animator.class"WIDTH=100 HEIGHT=100>
    <PARAM NAME="imgNumber" VALUE=4>//</PARAM>
    </APPLET>
    </BODY>
    </HTML>
      

  4.   

    跟代码没什么关系吧,用appletviewer运行的时候很正常啊,,
    类和网页文件放在同一个目录了。
    平时很少写applet,突然写个居然出这么多麻烦。
      

  5.   

    你可以试一下这样解决。
    用javac -target 1.1 Animator.java来编译你的类文件。因为JDK1.4编译出来的Applet可能必须用在有JRE的机器上,用 -target 1.1来指定版本编译,可以使你的Applet兼顾Microsoft VM.