在html页面中包含Applet

时间:2017-03-31 08:44:58

标签: java applet

想要在我的html页面中包含一个applet,我在我的html页面中使用一个对象来包含我的java应用程序的jar文件,但这个jar文件从未启动过,所以我无法运行定义的函数我的java应用程序......

这是我的代码:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
       <head>
        <link href="../includes/LMSTestContentPackages_style.css" rel="stylesheet" type="text/css"/>
          <script type="text/javascript" src="../common/EmulationCode.js"></script>
          <script type="text/javascript" src="../common/BrowserDetect.js"></script>
          <script type="text/javascript" src="../common/About.js"></script>
          <script type="text/javascript" src="../common/lmsrtefunctions.js"></script>
          <title>Sequencing Test SCO </title>
          <script type="text/javascript">
          //<!-- [CDATA[
             var driver = null;
             var launchTestPassed = true;

             function performTest()
             {
                DetectBrowser();
                if ( ! IE )
                {
                   driver = document.getElementById('NNLMSTestSCODriver');
                }
                else 
                {
                   driver = document.getElementById('LMSTestSCODriver');
               }
                launchTestPassed = driver.testLaunch();
          </script>
       </head>
     <body onload="performTest();">
         <div>
         <!-- LMSTestSCODriver -->
                <!--[if !IE]> Firefox and others will use outer object -->
                <object
                    classid="java:org/adl/testsuite/rte/lms/comm/LMSTestSCOApplet.class"
                    codetype="application/x-java-applet"
                    codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0_16-windows-i586.cab"
                    type="application/x-java-applet"
                    archive="LMSTest.jar" height="450" width="450" 
                    name="NNLMSTestSCODriver"
                    id="NNLMSTestSCODriver">

                    <!-- Konqueror browser needs the following param -->
                    <param name="archive" value="./LMSTest.jar" />
                    <param name="code" value="org/adl/testsuite/rte/lms/comm/LMSTestSCOApplet.class" />
                    <param name="MAYSCRIPT" value="true" />
                    <param name="scriptable" value ="true" />
                    <param name="java_codebase" value="../common" />
                    <param name="separate_jvm" value="true">

                    <!--<![endif]-->

                    <!-- MSIE (Microsoft Internet Explorer) will use inner object -->
                    <object name="LMSTestSCODriver" id="LMSTestSCODriver"
                        classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                        codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0_16-windows-i586.cab"
                        height="0" width="0">

                        <param name="code" value="org/adl/testsuite/rte/lms/comm/LMSTestSCOApplet.class" />
                        <param name="codebase" value="../common" />
                        <param name="archive" value="LMSTest.jar" />
                        <param name="name" value="SCO" />
                        <param name="type" value="application/x-java-applet" />
                        <param name="separate_jvm" value="true">

                        <strong> This browser does not have a Java Plug-in. <br />
                            <a href="http://java.sun.com/products/plugin/downloads/index.html">
                                Get the latest Java Plug-in here. </a> </strong>
                    </object>


                    <!--[if !IE]> close outer object -->
                </object>
                <!--<![endif]-->
                </div>
            <div id="scoPage">
                <p class="darkBlue_text"> 
                <!-- align="left" removed, need a .css to do formatting-->

                    LMS Test

                    <br />
                    <br />
                    Sequencing Test SCO
                    <br />
                    <br />
                    </p>
                <div id="teststatus">

      </body>
    </html>

函数testLaunch()LMSTestSCOApplet.class类中定义。问题是,这个函数(testLaunch())永远不会启动。我认为jar文件永远不会启动,但我不知道我的代码中的错误在哪里。

有什么想法吗?

0 个答案:

没有答案