This discussion is archived
1 Reply Latest reply: Dec 10, 2012 2:59 AM by gimbal2 RSS

<applet> tag vs <Object> tag

978934 Newbie
Currently Being Moderated
As per W3Schools HTML applet tag is not supported in HTML5. Need to use <Object> tag instead of <applet> tag.
For more details follow this link: http://www.w3schools.com/tags/tag_applet.asp
http://dev.w3.org/html5/spec/obsolete.html#the-applet-element
Point 11.2 Non-conforming features

So, I go ahead and the change the code as below depicted.

Below code that is working with <APPLET> tag:

+<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, whcih have been changed 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>+

After changing the *<applet>* tag to *<object>* tag , my applet itself is not loading and it gives class not found exception for jtreeviewapplet.JTreeViewAppletMain.class.

(Note: For both working and not working condition, I am using latest JDK 1.7 update 9 for compiling the code and in my system I am having latest JRE1.7 update 9 to run the applet code. I am using InternetExplorer 8 and InternetExplorer 9 browser)

Can anybody help me to find out where I am going wrong?

Edited by: 975931 on Dec 12, 2012 1:24 AM
  • 1. Re: <applet> tag vs <Object> tag
    gimbal2 Guru
    Currently Being Moderated
    You might want to stick to the documentation:

    http://docs.oracle.com/javase/tutorial/deployment/index.html

    and use the deployment toolkit.

    PS: use \
     tags when posting anything code related. That makes it readable and it keeps the forum from trying to interpret it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points