我用Applet写了程序,程序如下:
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWord extends Applet
{
public void paint(Graphics g) 
{
             g.drawString("Hello Word!",50,200);
}
}
在执行完“javac HelloWorld.java”后生成了“HelloWorld.class”文件。然后为了查看生成html文件,
HelloWorld.html文件如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD> <BODY>
  <APPLET CODE=HelloWord.class
  WIDTH=500  HEIGHT=300>
  </APPLET>
 </BODY>
</HTML>
执行“AppletViewer HelloWorld.html”可以看到正确的结果,可是用IE却无法看到结果,我看书上说用IE也可以的,求帮助,怎么可以实现?在线等。

解决方案 »

  1.   

    If you see "Applet can't start: class HelloWorld not found" in your browser's status line, it can mean one of two things: 1.   The .class file(s) are not named correctly. Java is case-sensitive, so be sure to follow precise capitalization.
     2.   The .class file(s) are not in the correct directory. They should be located in the path indicated in the CODEBASE= portion of the <APPLET> tag, or the directory of your HTML document if no CODEBASE= is specified. Hope it helps.//Ali
      

  2.   

    网页上没有显示"Applet can't start: class HelloWorld not found"
    只是有个框子,框子左上角有个叉,其他都不显示。是什么原因
      

  3.   

    可是不是他说的那个问题啊,他说页面会显示“Applet can't start: class HelloWorld not found"
    没有显示啊,而且他说的两个问题:
    1.class文件命名错误,java对英文大小写很敏感。
    2.class文件不再当前目录。
    我没有这两个问题。命名和路径都是正确的,有没有其他可能性?
      

  4.   

    这个肯定是你html找不到.class文件。你把class放到一个盘得根目录,然后用绝对路径试试
      

  5.   

    我本来就是把class,java,html放在C盘的根目录,用绝对路径访问的,不行。。
      

  6.   

    你的那个class文件到底是HelloWord.class还是HelloWorld.class!?
      

  7.   

    public class HelloWord extends Applet
    {
    public void paint(Graphics g)  
    {
      g.drawString("Hello Word!",50,200);
    }
    }
    在执行完“javac HelloWorld.java”后生成了“HelloWorld.class”文件。然后为了查看生成html文件,
      

  8.   

    我上面写错了。我用的全是HelloWord,命令也是javac HelloWord.java,生成的文件是“HelloWord.class”,HelloWord.html文件:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="">
      <META NAME="Keywords" CONTENT="">
      <META NAME="Description" CONTENT="">
     </HEAD> <BODY>
      <APPLET CODE=HelloWord.class
      WIDTH=500 HEIGHT=300>
      </APPLET>
     </BODY>
    </HTML>
    用AppletViewer HelloWord.html是正确的,可是用IE察看却错误,不知道是什么问题继续求解中
      

  9.   

    哦 遇到过这个问题 就是网页上显示applet的区域出现一个提示信息...
    竟然你用AppletViewer可以看到页面效果,说明程序代码方面是通过了的
    可以尝试:
    设置ie的安全级别,查看浏览器是否支持Java Applet的运行.
      

  10.   

    为什么我点击“允许阻止的内容”还是不行。我用的是IE8,lxd991236,请问你用的是哪个版本的IE浏览器?
      

  11.   

    大家理我一下啦。我急用。到底怎么样才能让IE看到java Applet程序生成的html文件??
      

  12.   

    建议更换一个浏览器试试,我的是谷歌chrome浏览器很方便观看最后的结果
      

  13.   

    我的IE缺了插件,sun java控制台,安装上就好了