刚才帮你测试了,你的程序没问题但是你有很多东西没理解!
将public void init()
  {
    label=new Label();
    System.out.println("applet is inited");
    label.setText(label.getText()+"Applet is inited");
    }
改成
public void init()
  {
    label=new Label();
    System.out.println("applet is inited");
    label.setText(label.getText()+"Applet is inited");
    this.add(label);
    }
然后在同一个目录中新建一个名为myapplet.html文件,在其中输入
<applet code="MyApplet.class"
        width="400"
height="400">
</applet>然后在dos下运行javac MyApplet.java
最后运行appletviewer myapplet.html
你看到什么了?
可以了!有问题么?