根据W3Schools,HTML5不支持HTML applet标记。需要使用<Object>
代码而不是<applet>
代码。
有关详细信息,请访问以下链接:http://www.w3schools.com/tags/tag_applet.asp
http://dev.w3.org/html5/spec/obsolete.html#the-applet-element
要点11.2不符合要求
所以,我继续改变代码。
以下使用<APPLET>
代码的代码:
<Applet
style = "position:absolute;border:0px;left:184;top:95;height:180;width:364;"
code = "jtreeviewapplet.JTreeViewAppletMain.class"
name = "TreeView"
id = "TreeView"
hspace = "0"
vspace = "0"
align = "top"
archive = "/Project/HTML/ABC/XYZ.jar,/Project/HTML/ABC/ABC.jar"
MAYSCRIPT>
<PARAM NAME="onSelected" VALUE="onSelect_Handler">
<PARAM NAME="onFinishNormalize" VALUE="onFinishNormalize_Handler">
</Applet>
Here is the snippet; I changed <APPLET> tag to <OBJECT> tag so as to support HTML5 in future:
<OBJECT type=" application/x-java-applet"
style = "position:absolute;border:0px;left:184;top:95;height:180;width:364;"
name = "TreeView"
id = "TreeView"
hspace = "0"
vspace = "0"
align = "top"
>
<PARAM name="code" value=”jtreeviewapplet.JTreeViewAppletMain.class”>
<PARAM name="codebase" value="/Project/HTML/ABC/">
<PARAM name="archive" value=" XYZ.jar">
<PARAM name="archive" value=" ABC.jar">
<PARAM name="scriptable" value="true">
<PARAM NAME="onSelected" VALUE="onSelect_Handler">
<PARAM NAME="onFinishNormalize" VALUE="onFinishNormalize_Handler">
</OBJECT>
将<applet>
标记更改为<object>
标记后,我的applet本身未加载,并且它为jtreeviewapplet.JTreeViewAppletMain.class提供了类找不到异常。
(注意:对于工作和非工作状态,我使用最新的JDK 1.7更新9来编译代码,在我的系统中,我有最新的JRE1.7更新9来运行applet代码。我正在使用InternetExplorer 8和InternetExplorer 9浏览器)
答案 0 :(得分:1)
仅仅将applet
替换为object
是不够的。请阅读http://www.ailis.de/~k/archives/63-How-to-use-Java-applets-in-modern-browsers.html以获取示例。