File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes OBJECT tag for applets..... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "OBJECT tag for applets....." Watch "OBJECT tag for applets....." New topic

OBJECT tag for applets.....


Joined: May 29, 2001
Posts: 6
when do we need to use OBJECT tag in our HTML page, over the APPLET tag..
i would be thankful for detalied answers...
Suneel Setlur
Ranch Hand

Joined: Nov 26, 2000
Posts: 202

Try this link here

Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123
You need the object tag around your applet if you are deploying a Swing based applet and you need to force your users to use the jvm from the Sun Java plugin. The best way to get a properly formatted object tag is to download the free Sun html converter
( and run it on your html or jsp page. This will automatically comment out your applet tag and replace it with a correctly formatted object tag, plus an embed tag for yucky Netscape. So the result of converting this tag:
<APPLET CODE = "SwingApplet.class" WIDTH = 500 HEIGHT = 550>
<PARAM NAME = CODE VALUE = �SwingApplet.class" >
<PARAM NAME = ARCHIVE VALUE = "SwingApplet.jar" >
<PARAM NAME = TYPE VALUE ="application/x-java-applet;version=1.3">
Would be this converted tag:

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 500 HEIGHT = 550 codebase=",3,0,0" NAME="SwingApplet">
<PARAM NAME = NAME VALUE = "SwingApplet" >
<PARAM NAME = CODE VALUE = " SwingApplet.class" >
<PARAM NAME = ARCHIVE VALUE = "SwingApplet.jar" >
<PARAM NAME=TYPE VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="false">
<EMBED type="application/x-java-applet;version=1.3" NAME="SwingApplet" CODE = " SwingApplet.class" CODEBASE = "classes" ARCHIVE = "SwingApplet.jar" WIDTH = 500 HEIGHT = 550 type = "application/x-java-applet;version=1.3" scriptable=false pluginspage="">
<APPLET CODE = "SwingApplet.class" WIDTH = 500 HEIGHT = 550>
<PARAM NAME = CODE VALUE = �SwingApplet.class" >
<PARAM NAME = ARCHIVE VALUE = "SwingApplet.jar" >
<PARAM NAME = TYPE VALUE ="application/x-java-applet;version=1.3">
Also, an inserted parameter is "scriptable". You have to make sure and set this to true if you want to call any public applet methods from JavaScript.
Rohit Agarwal

Joined: Jul 13, 2001
Posts: 9
Hi Julia,
In the last line of your answer you have written that you need to give the scriptable attribute as true in the PARAM tag. I wanted to know how do you call a public method in the applet from javascript. Say if i have a an applet and i have put it in a jar how do i call that applets method using javascript.
It was possible if i was using applet tag, coz then i can use document.applets[appname].methodname()
but now with the object / embed tag how to do the same.
I agree. Here's the link:
subject: OBJECT tag for applets.....