import java.awt.*;
import java.applet.*;
public class HelloWorldApplet extends Applet {
public void paint(Graphics g) {
g.drawString("Welcome to Java!!", 20, 20 );
}
}

解决方案 »

  1.   

    嘿,这是APPLET,要在网页上运行的,你要测试就用HELLOWORLD
    public class HelloWorld{
        public static void main(String[] args){
            System.out.println("Hello World!!!");
        }
    }
      

  2.   

    这个程序是不能直接进行。这是一个Applet
    你把它编译了之后,新建一个html文件。
    <html>
    <applet code=HelloWorldAppletl.class width=300 height=200>
    </applet>
    </html>
    然后用IE打开
      

  3.   

    /*<applet code=HelloWorldAppletl.class width=300 height=200>
    </applet>*/
    把其加到java文件的头部,用appletviewer打开