拷下来的:
import java.applet .*;
import java.awt.*;public class HelloWorld  extends Applet 
{
public void paint(Graphics g)
{
g.drawString ("你好,Java世界!",2,20);
}
}

解决方案 »

  1.   


       右键我的电脑--》属性--》高级--》环境环境变量
         classpath=.;jdk安装目\lib
         path=jdk安装目录\bin有没有重新启一个cmd?
      

  2.   

    你将
    import java.applet .*;
    改成
    import java.applet.*;
    去掉空格试一下。
      

  3.   

    老大,你的程序根本没有Main()如何运行啊?
      

  4.   

    将你的程序改成
    import java.applet .*;
    import java.awt.*;public class HelloWorld  extends Applet 
    {
    public void paint(Graphics g)
    {
    g.drawString ("你好,Java世界!",2,20);
    }
              public void static main(String args[])
             {
             }
    }
    实验一下。
      

  5.   

    applet需要写html页面来运行
    <html>
    <head>
    <title>Draw Circle Applet</title>
    </head>
    <body bgcolor="#996633">
    <applet code="HelloWorld.class" height="350" width="350">
    </applet>
    </body>
    </html>
      

  6.   

    换成
    /** 
     * The HelloWorldApp class implements an application that
     * simply displays "Hello World!" to the standard output.
     */
    class HelloWorldApp {
        public static void main(String[] args) {
            System.out.println("Hello World!"); //Display the string.
        }
    }
    就好了!
    还有:
         classpath=.;jdk安装目\lib
         path=jdk安装目录\bin
    都表示什么意思??我把classpath设成bin的路径了,上面的代码也能通过.
      

  7.   

    classpath表示你的类路径啊。也就是说,import的时候系统会从classpath中设置的纵多路径中开始寻找,path当然是应用程序的位置,为什么你在任何目录都可以运行Java.exe就是由于path的缘故。classpath应该加上
    dt.jar和tools.jar
      

  8.   

    诸位好:
    我是在jbuilder中调试的代码,也有同样的问题,请指教。
    源码同灌蓝高手的一样,HTML中APPLET的代码是这样:
    <APPLET 
     CODE="TestApplet.class"
     ALT="Java Not Supported"
     ALIGN=MIDDLE
     VSPACE=50
     HSPACE=50
     WIDTH=600 
     HEIGHT=200>
    </APPLET>但运行HTML时显示:java.lang.ClassNotFoundException:TestApplet.class
    运行状态栏提示:没找到TestApplet.class类
    请问在Jbuilder中该如何设置工程属性和路径,也需要设置环境变量吗?HTML文件中该怎样写代码?
    谢谢!
      

  9.   

    study_body(为什么总是长不大) :
           dt.jar和tools.jar都有,谢谢你指点
    cqfeng() :
       applet需要写html页面来运行
    <html>
    <head>
    <title>Draw Circle Applet</title>
    </head>
    <body bgcolor="#996633">
    <applet code="HelloWorld.class" height="350" width="350">
    </applet>
    </body>
    </html>
    这些代码应在哪里写呢??我一点都不知道...
      

  10.   

    自己用写字版编写一个文件,内容为
    <html>
    <head>
    <title>Draw Circle Applet</title>
    </head>
    <body bgcolor="#996633">
    <applet code="HelloWorld.class" height="350" width="350">
    </applet>
    </body>
    </html>
    如wei__wang(灌篮敌手)所写,之后将文件存储,文件名为xxx.htm
    之后将用浏览器打开该文件看结果如何?
      

  11.   

    sdduwa(乔乔):你要是男孩,我就要怪你
                 你要是女孩,我就放过你!还有一个问题:
     怎么把.class文件放到网页文件中,网页文件又要怎么建立,
     我用notepad和JDK.
      

  12.   

    study_body(为什么总是长不大)
    运行结果就是:
    java.lang.ClassNotFoundException:TestApplet.class