应该是appletviewer donothig.html或者......htm

解决方案 »

  1.   

    c:\j2sdk1.4.2\bin; 不应该放在classpath里面,还有java_home里面应该是c:\j2sdk1.4.2;
      

  2.   

    没有初始化
    import java.applet.Applet; public class DoNothing extends Applet 
    {
    public void init(){ 
    }
    }
      

  3.   

    init()这个函数再applet里必须覆写
      

  4.   

    环境变量应该这样设置吧:
    CLASSPATH=C:\j2sdk1.4.2\lib\tools.jar;.;c:\j2sdk1.4.2\lib\dt.jar;你少了一个最重要的点!!!
      

  5.   

    上面的小错误我都改过来了,也按照你们的指教改过来了,可用appletviewer donothing.html运行时还是这样什么提示也没有.用IE打开的却是源程序。环境变量也改过来了!
      

  6.   

    是你的Applet里面有Java.io.*里面的操作,也就是对本地文件的操作,这在Web上是不允许的。
    把你的Applet里面的有关本地文件操作代码去掉,然后重新编译,即可。
      

  7.   

    jdb也重装了甚至换过版本还是不行
      

  8.   

    IE打开的怎么可能是源程序?是HTML源程序?那肯定是Applet标记没写好啦
      

  9.   

    源程序改为如下:
    import java.applet.Applet;
    public class DoNothing extends Applet
    {
               public  void  init(){ };  
    }
    怎样去掉APPLET里面的有关本地文件操作代码?能否详细描述一下,因我是个初学者刚学没几天,多谢了!
      

  10.   

    你的问题在别人那里不能重现,大家就不容易帮你搞定,你把所有的东西重新发表一遍。
    象我这样。
    ================================
    =源文件:myapplet\MyApplet.java=
    ================================
    package myapplet;
    import java.applet.*;
    public class MyApplet extends Applet {
        public MyApplet() {
        }
        public void init() {
        }
    }
    =========================
    =html文件:MyApplet.html=
    =========================
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK">
    <title>
    HTML Test Page
    </title>
    </head>
    <body>
    myapplet.MyApplet will appear below in a Java enabled browser.<br>
    <applet
      codebase = "."
      code     = "myapplet.MyApplet.class"
      name     = "TestApplet"
      width    = "400"
      height   = "300"
      hspace   = "0"
      vspace   = "0"
      align    = "middle"
    >
    </applet>
    </body>
    </html>
    ==========
    =目录结构=
    ==========
    src--
        |__myapplet--
                    |__MyApplet.java
    classes--
            |__myapplet--
            |           |__MyApplet.class
            |
            |__MyApplet.html顺便检查你的ie中设置:在高级选项中,是否使用了正确的jre解释applet。
      

  11.   

    我建议你拿个工具生成一个简单的APPLET,然后观察下它生成的所有文件和代码。
    比如VAJ。
    或者就拿 wb_0410(天煞) 的代码比较就可以了。
    还有,最大可能是你的HTML不对。
      

  12.   

    还有你的题目太夸张了。
    sweat y
      

  13.   

    问题解决了,谢谢各位!我是一个新手问题的描述不是很清楚,让各位高手疑惑,实在是不好意思!因为我的HTML文件是用WORD编写的,后来我在FONTPAGE里重新输入后,运行就一点问题也没有。我也不明白这是什么原因,多谢大家!
      

  14.   

    微软是希望能用word编辑html,提高word与frontpage的结合,不过你可以看一下word创建的html文件,里面比单纯的html文件多了很多其他的东西。
    下面是一个用word生成的html文件,里面就输入了一句话:This is a html file edited by word.但是你可以看一下它的源文件:呵呵。
    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns="http://www.w3.org/TR/REC-html40"><head>
    <meta http-equiv=Content-Type content="text/html; charset=gb2312">
    <meta name=ProgId content=Word.Document>
    <meta name=Generator content="Microsoft Word 10">
    <meta name=Originator content="Microsoft Word 10">
    <link rel=File-List href="word.files/filelist.xml">
    <title>This is a html file edited by word</title>
    <!--[if gte mso 9]><xml>
     <o:DocumentProperties>
      <o:Author>wangbo</o:Author>
      <o:LastAuthor>wangbo</o:LastAuthor>
      <o:Revision>1</o:Revision>
      <o:TotalTime>1</o:TotalTime>
      <o:Created>2003-09-15T05:42:00Z</o:Created>
      <o:LastSaved>2003-09-15T05:43:00Z</o:LastSaved>
      <o:Pages>1</o:Pages>
      <o:Words>5</o:Words>
      <o:Characters>31</o:Characters>
      <o:Company>runway</o:Company>
      <o:Lines>1</o:Lines>
      <o:Paragraphs>1</o:Paragraphs>
      <o:CharactersWithSpaces>35</o:CharactersWithSpaces>
      <o:Version>10.2625</o:Version>
     </o:DocumentProperties>
    </xml><![endif]--><!--[if gte mso 9]><xml>
     <w:WordDocument>
      <w:GrammarState>Clean</w:GrammarState>
      <w:PunctuationKerning/>
      <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
      <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
      <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
      <w:Compatibility>
       <w:SpaceForUL/>
       <w:BalanceSingleByteDoubleByteWidth/>
       <w:DoNotLeaveBackslashAlone/>
       <w:ULTrailSpace/>
       <w:DoNotExpandShiftReturn/>
       <w:AdjustLineHeightInTable/>
       <w:BreakWrappedTables/>
       <w:SnapToGridInCell/>
       <w:WrapTextWithPunct/>
       <w:UseAsianBreakRules/>
       <w:UseFELayout/>
      </w:Compatibility>
      <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
     </w:WordDocument>
    </xml><![endif]-->
    <style>
    <!--
     /* Font Definitions */
     @font-face
    {font-family:宋体;
    panose-1:2 1 6 0 3 1 1 1 1 1;
    mso-font-alt:SimSun;
    mso-font-charset:134;
    mso-generic-font-family:auto;
    mso-font-pitch:variable;
    mso-font-signature:3 135135232 16 0 262145 0;}
    @font-face
    {font-family:"\@宋体";
    panose-1:2 1 6 0 3 1 1 1 1 1;
    mso-font-charset:134;
    mso-generic-font-family:auto;
    mso-font-pitch:variable;
    mso-font-signature:3 135135232 16 0 262145 0;}
     /* Style Definitions */
     p.MsoNormal, li.MsoNormal, div.MsoNormal
    {mso-style-parent:"";
    margin:0cm;
    margin-bottom:.0001pt;
    text-align:justify;
    text-justify:inter-ideograph;
    mso-pagination:none;
    font-size:10.5pt;
    mso-bidi-font-size:12.0pt;
    font-family:"Times New Roman";
    mso-fareast-font-family:宋体;
    mso-font-kerning:1.0pt;}
     /* Page Definitions */
     @page
    {mso-page-border-surround-header:no;
    mso-page-border-surround-footer:no;}
    @page Section1
    {size:595.3pt 841.9pt;
    margin:72.0pt 90.0pt 72.0pt 90.0pt;
    mso-header-margin:42.55pt;
    mso-footer-margin:49.6pt;
    mso-paper-source:0;
    layout-grid:15.6pt;}
    div.Section1
    {page:Section1;}
    -->
    </style>
    <!--[if gte mso 10]>
    <style>
     /* Style Definitions */
     table.MsoNormalTable
    {mso-style-name:普通表格;
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:10.0pt;
    font-family:"Times New Roman";}
    </style>
    <![endif]-->
    </head><body lang=ZH-CN style='tab-interval:21.0pt;text-justify-trim:punctuation'><div class=Section1 style='layout-grid:15.6pt'><p class=MsoNormal><span lang=EN-US>This is a html file edited by word.</span></p></div></body></html>