Java Applet errors on Web Hosting site

我的梦境 提交于 2019-12-02 07:27:33

So my question would be this: how do I correctly use the <Object> tag for a Java Applet?

The correct answer is "don't use it" (or the applet element). Instead delegate the responsibility for embedding the applet to deployJava.js. It might look something like this.

<script src="http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {
    codebase:'http://morganaprime.webs.com/',
    code:'net.mp.eoncalculator.VirtualArmory',
    archive:'VirtualArmory.jar',
    width:710, 
    height:540
};
var parameters = {gunSize:16};
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>

But NetBeans did state a warning message stating that the <Applet> tag has been deprecated..

Only since HTML 4.01 (which was a long time ago)!

Update - working example

<html>
<body>
<script src="http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {
    codebase:'http://morganaprime.webs.com/',
    code:'net.mp.eoncalculator.VirtualArmory',
    archive:'VirtualArmory.jar',
    width:1000,
    height:700
};
var parameters = {gunSize:16};
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
</body>
</html>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!