File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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
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:
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">
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 ")
Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

Hello Mohammad
Thank you for that piece of informaton
lemme try it out....
I agree. Here's the link:
subject: Calling jar in an applet
It's not a secret anymore!