JApplet not running: < No>

前端 未结 2 799
情歌与酒
情歌与酒 2021-01-21 23:26

My JApplet is producing a error when DrawOvalInputs.html runs and calls the class file of DrawOvalInputs. So far, I have only been able to get it work as an actual application

相关标签:
2条回答
  • 2021-01-22 00:25

    you must call it with the right path

    if your path is like

    DrawOvalApplet\build\classes\drawovalapplet\DrawOvalInputs.class
    

    and your .html is in

    DrawOvalApplet\build\DrawOvalInputs.html
    

    call it

     ...
          <applet code=classes.drawovalapplet.DrawOvalInputs.class width=400 height=400>
          </applet>
     ...
    

    much better your .html is in

    DrawOvalApplet\build\classes\DrawOvalInputs.html
    

    call it

     ...
          <applet code=drawovalapplet.DrawOvalInputs.class width=400 height=400>
          </applet>
     ...
    

    result :

    enter image description here

    applet running

    enter image description here

    You can call htmlconverter and let do it for you

    java -jar htmlconverter.jar -gui
    

    enter image description here

    Result DrawOvalInputs.html

    <html>
      <body>
          <!--"CONVERTED_APPLET"-->
    <!-- HTML CONVERTER -->
    <object
        classid = "clsid:CAFEEFAC-0017-0000-0051-ABCDEFFEDCBA"
        codebase = "http://java.sun.com/update/1.7.0/jinstall-7u51-windows-i586.cab#Version=7,0,510,13"
        WIDTH = 400 HEIGHT = 400 >
        <PARAM NAME = CODE VALUE = drawovalapplet.DrawOvalInputs.class >
        <param name = "type" value = "application/x-java-applet;jpi-version=1.7.0_51">
        <param name = "scriptable" value = "false">
    
        <comment>
        <embed
                type = "application/x-java-applet;jpi-version=1.7.0_51" \
                CODE = drawovalapplet.DrawOvalInputs.class \
                WIDTH = 400 \
                HEIGHT = 400
            scriptable = false
            pluginspage = "http://java.sun.com/products/plugin/index.html#download">
            <noembed>
    
                </noembed>
        </embed>
        </comment>
    </object>
    
    <!--
    <APPLET CODE = drawovalapplet.DrawOvalInputs.class WIDTH = 400 HEIGHT = 400>
    
    
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->
    
      </body>
    </html>
    
    0 讨论(0)
  • 2021-01-22 00:28

    Use the class file and the actual file path and name. For example:

     <applet code=DrawOvalInputs.class width=400 height=400>
      </applet>
    

    if the class file is located in the same folder as your HTML file.

    0 讨论(0)
提交回复
热议问题