aspose file tools*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "OBJECT tag for applets....." Watch "OBJECT tag for applets....." New topic
Author

OBJECT tag for applets.....

NIKHIL JAIN
Greenhorn

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
Hi

Try this link here
Suneel


Suneel
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
( http://java.sun.com/products/plugin/1.3/docs/html_converter.html) 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 = CODEBASE VALUE = "classes" >
<PARAM NAME = ARCHIVE VALUE = "SwingApplet.jar" >
<PARAM NAME = TYPE VALUE ="application/x-java-applet;version=1.3">
</APPLET>
Would be this converted tag:

<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.3 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 500 HEIGHT = 550 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0" NAME="SwingApplet">
<PARAM NAME = NAME VALUE = "SwingApplet" >
<PARAM NAME = CODE VALUE = " SwingApplet.class" >
<PARAM NAME = CODEBASE VALUE = "classes" >
<PARAM NAME = ARCHIVE VALUE = "SwingApplet.jar" >
<PARAM NAME=TYPE VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="false">
<COMMENT>
<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="http://java.sun.com/products/plugin/1.3/plugin-install.html">
<NOEMBED>
</COMMENT>
</NOEMBED></EMBED>
</OBJECT>
<!--
<APPLET CODE = "SwingApplet.class" WIDTH = 500 HEIGHT = 550>
<PARAM NAME = CODE VALUE = �SwingApplet.class" >
<PARAM NAME = CODEBASE VALUE = "classes" >
<PARAM NAME = ARCHIVE VALUE = "SwingApplet.jar" >
<PARAM NAME = TYPE VALUE ="application/x-java-applet;version=1.3">
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
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.
Julia
Rohit Agarwal
Greenhorn

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.
Rohit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OBJECT tag for applets.....