This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

OBJECT tag for applets.....

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when do we need to use OBJECT tag in our HTML page, over the APPLET tag..
i would be thankful for detalied answers...
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Try this link here
Suneel
 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Bookmark Topic Watch Topic
  • New Topic