将Java applet放到网上(netbeans)

时间:2011-11-07 19:10:22

标签: java javascript html netbeans applet

**尽管看起来有多长,我知道它很简单,我只是添加了很多细节,netbeans生成了所有的JAR,所以我只是想把javascript的东西(我不明白)来匹配与JAR'以及这应该如何运作。

基本上,我只是希望applet在下面的url的自己的窗口中弹出。

网站:http://dawnofvengeance.com/testchat/(哦,为什么索引页面上还有一个java错误框,为什么?它应该只是一个弹出窗口)我也刚刚意识到该框出现在另一个下面的链接目前适用于弹出设置。

我有一个已在这里工作的小程序http://dawnofvengeance.com/applications/

另外,我正在使用selenium的jar,这就是其中一个错误归还给我。

这是我的设置......(同样,我不确定在下面的HTML中指定JAR的所有内容都是完全的。)

如果您运行该页面,则表示selenium JAR存在某种错误。

注意:selenium jar在这个文件夹中以及lib文件夹中,因为我不确定它在哪里。在完成Clean和Build后,我从dist获得了launch.jar,launch.html和IGCTestApplication.jar,该应用程序是为Web设置的...所以我必须在HTML中出错#

HTML网页:

的index.html

Java Syntax (Toggle Plain Text)
<html>  <HEAD><title>RuneScape StatApp - V0.2.0</title><SCRIPT LANGUAGE="JavaScript"><!-- Idea by:  Nic Wolfe --><!-- This script and many more are available free online at --><!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Beginfunction popUp(URL) {day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=613,height=481,left = 499.5,top = 221');");}// End --></script>  <HEAD>     <h1><font color="#FFFFFF">Make sure to disable your pop-up blocker; if applet is blocked by browser, just allow pop-ups on this site then reload the page to start the applet again</font></h1> <BODY onLoad="javascript:popUp('http://www.dawnofvengeance.com/testchat/launch.html')"><body bgcolor="#000000"> <h3><font color="#FF0000">once applet shows up, you may exit this page.Thank you!-Austin</font></h3><p><p><h4><font color="#FFFFFF">Please report any bugs to Run You Camper on the IGC forum page, or just click <a href="http://www.igcgamers.com/forum/ucp.php?i=pm&mode=compose&u=18216">here</a></font></h4> <!-- Script Size:  0.73 KB  --> <applet code="com.dawnofvengeance" archive="IGCChatApplication.jar"/>   </html><html>


<HEAD>
<title>
RuneScape StatApp - V0.2.0
</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by:  Nic Wolfe -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=613,height=481,left = 499.5,top = 221');");
}
// End -->
</script>


<HEAD>





<h1><font color="#FFFFFF">Make sure to disable your pop-up blocker; if applet is blocked by browser, just allow pop-ups on this site then reload the page to start the applet again</font></h1>

<BODY onLoad="javascript<b></b>:popUp('http://www.dawnofvengeance.com/testchat/launch.html')">
<body bgcolor="#000000"> 
<h3><font color="#FF0000">once applet shows up, you may exit this page.
Thank you!
-Austin</font></h3>
<p><p>
<h4><font color="#FFFFFF">Please report any bugs to Run You Camper on the IGC forum page, or just click <a href="http://www.igcgamers.com/forum/ucp.php?i=pm&mode=compose&u=18216">here</a></font></h4>

<!-- Script Size:  0.73 KB  -->

<applet code="com.dawnofvengeance" archive="IGCChatApplication.jar"/> 


</html>

launch.html

Java Syntax (Toggle Plain Text)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><!-- ########################## IMPORTANT NOTE ############################ --><!-- This preview HTML page will work only with JDK 6 update 10 and higher! --><!-- ###################################################################### --><html>    <head>        <title>Test page for launching the applet via JNLP</title>    </head>    <body>        <h3>Test page for launching the applet via JNLP</h3>        <script src="http://java.com/js/deployJava.js"></script>        <script>            var attributes = {                code:       "mypackage.RunescapeStatsApplet",                archive:    "IGCChatApplication.jar, lib/selenium-server-standalone-2.9.0.jar",                width:      900,                height:     900            };            var parameters = {jnlp_href:"launch.jnlp"}; <!-- Applet Parameters -->            var version = "1.5"; <!-- Required Java Version -->            deployJava.runApplet(attributes, parameters, version);        </script>        <!-- Or use the following applet element to launch the applet using jnlp_href -->        <!--        <applet width="900" height="900">            <param name="jnlp_href" value="launch.jnlp"/>        </applet>        -->    </body></html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- ########################## IMPORTANT NOTE ############################ -->
<!-- This preview HTML page will work only with JDK 6 update 10 and higher! -->
<!-- ###################################################################### -->
<html>
    <head>
        <title>Test page for launching the applet via JNLP</title>
    </head>
    <body>
        <h3>Test page for launching the applet via JNLP</h3>
        <script src="http://java.com/js/deployJava.js"></script>
        <script>
            var attributes = {
                code:       "mypackage.RunescapeStatsApplet",
                archive:    "IGCChatApplication.jar, lib/selenium-server-standalone-2.9.0.jar",
                width:      900,
                height:     900
            };
            var parameters = {jnlp_href:"launch.jnlp"}; <!-- Applet Parameters -->
            var version = "1.5"; <!-- Required Java Version -->
            deployJava.runApplet(attributes, parameters, version);
        </script>
        <!-- Or use the following applet element to launch the applet using jnlp_href -->
        <!--
        <applet width="900" height="900">
            <param name="jnlp_href" value="launch.jnlp"/>
        </applet>
        -->
    </body>
</html>

tester.html

Java Syntax (Toggle Plain Text)
<html><HEAD> <SCRIPT LANGUAGE="JavaScript"><!-- Idea by:  Nic Wolfe --><!-- This script and many more are available free online at --><!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Beginfunction popUp(URL) {day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=615,height=483,left = 332.5,top = 270.5');");}// End --></script></head>   <BODY onLoad="javascript:popUp('http://www.dawnofvengeance.com/testchat/launch.html')"> </html><html>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by:  Nic Wolfe -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=615,height=483,left = 332.5,top = 270.5');");
}
// End -->
</script>
</head>



<BODY onLoad="javascript<b></b>:popUp('http://www.dawnofvengeance.com/testchat/launch.html')">

</html>

我相信你们可以找出JAR的去向, 再一次,这有点乱,所以我道歉,但是非常感谢你们! - 奥斯汀

编辑:

错误我

  

Java Plug-in 1.6.0_24使用JRE版本1.6.0_24-b07 Java HotSpot(TM)   客户端VM用户主目录= C:\ Users \ anderaus   -------------------------------------------------- - c:清除控制台窗口f:在完成队列g上完成对象g:
  垃圾收集h:显示此帮助消息l:dump classloader   list m:打印内存使用o:触发日志记录q:hide console r:   重新加载策略配置:转储系统和部署属性   t:dump thread list v:dump thread stack x:clear classloader

     

cache 0-5:将跟踪级别设置为

     

sun.plugin2.main.client.PluginMain:无法识别的消息ID 42   异常:无法加载资源:   wwwdawnofvengeancecom / testchat / lib目录/硒服务器独立-2.9.0.jar。   com.sun.deploy.net.FailedDownloadException:无法加载资源:   wwwdawnofvengeancecom / testchat / lib目录/硒服务器独立-2.9.0.jar     at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)     at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)     at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)     在com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(未知   来源)at   com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(未知   来源)com.sun.deploy.net.DownloadEngine.getResource(未知   来源)com.sun.javaws.LaunchDownload $ DownloadTask.call(未知   来自java.util.concurrent.FutureTask $ Sync.innerRun(未知   来自)java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(未知来源)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在java.lang.Thread.run(未知来源)引起:   java.io.EOFException:ZLIB输入流的意外结束   java.util.zip.InflaterInputStream.fill(未知来源)at   java.util.zip.InflaterInputStream.read(未知来源)at   java.util.zip.ZipInputStream.read(未知来源)at   com.sun.deploy.net.HttpDownloadHelper.decompressWrite(未知来源)     在com.sun.deploy.net.HttpDownloadHelper.download(未知来源)at   com.sun.deploy.cache.Cache.downloadResourceToTempFile(未知来源)     at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)     at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)     at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)     at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)     在com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(未知   来源)at   com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(未知   来源)com.sun.deploy.net.DownloadEngine.getResource(未知   来源)com.sun.javaws.LaunchDownload $ DownloadTask.call(未知   来自java.util.concurrent.FutureTask $ Sync.innerRun(未知   来自)java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(未知来源)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     at java.lang.Thread.run(Unknown Source)异常:   com.sun.deploy.net.FailedDownloadException:无法加载资源:   wwwdawnofvengeancecom / testchat / LIB /硒 - 服务器 - 独立-2.9.0.jar

1 个答案:

答案 0 :(得分:1)

正如我所见,您正在尝试下载外部lib。那是JS说的

var attributes = {
                code:       "mypackage.RunescapeStatsApplet",
                archive:    "IGCChatApplication.jar, lib/selenium-server-standalone-2.9.0.jar",
                width:      900,
                height:     900
            };

我建议不要以这种方式使用外部库,而是将其添加到applet jar中。这条路径为

  

LIB /硒 - 服务器 - 独立-2.9.0.jar

应该在你的

  

IGCChatApplication.jar

...当然,要说更多,我需要了解您的applet是如何配置的,以及如何导入丢失的lib。至少尝试按照我的说法重新配置你的applet ...如果出现一些额外的错误,我希望问题是更详细的:)

祝你好运