aspose file tools*
The moose likes Applets and the fly likes Calling jar in an applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Calling jar in an applet" Watch "Calling jar in an applet" New topic
Author

Calling jar in an applet

Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

I need to call two or more jars to execute an applet and run it in Tomcat.Please help me with the html code tom call these jars onto this applet.Also tell me in whih directory of Tomact we must place these jars.


SCJP 5.0 and now fighting with ExtJS
Mohammad Farhat
Ranch Hand

Joined: Nov 17, 2005
Posts: 51
Hi,
to call an applet from an html, you should have in the html an applet tag (duuuh)
inside the applet tag, you should place the following:
<applet
archive = "viewer.jar,dcm4che.jar"
code = "dicomviewer.Viewer.class"
name = "Viewer"
width = "600"
height = "500"
hspace = "0"
vspace = "0"
align = "middle"
><param name="debugLevel" value="30">
<param name="displayControls" value="true">
<param name="displayAnnotations" value="true">
</applet>
archive attribute: containing the names of jar files used by your applet
code: the main class of your applet (including the package name)
name: a name for you applet
width, height, hspace, vspace, and align : additional formatting attributes
as for the param elements (such as <param name="debugLevel" value="30"> these are optional parameters in case you need to pass some particular parameter to your applet
As for the location of your jar files, they have to be placed inside the webapps particular folder of your application in the same directory of the calling html file(<TomCat>\webapps\<applicationName> , you can even place them inside a new folder within the <TomCat>\webapps\<applicationName>\newFolder folder, then you would need to add an attribute to the applet tag containing the name of your folder (JAVA_CODEBASE = "newFolder ")
Best,
Mohammad
Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

Hello Mohammad
Thank you for that piece of informaton
lemme try it out....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Calling jar in an applet