wood burning stoves 2.0*
The moose likes Applets and the fly likes applet --jar confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "applet --jar confusion" Watch "applet --jar confusion" New topic
Author

applet --jar confusion

satyendra adhikari
Ranch Hand

Joined: Aug 17, 2001
Posts: 52
Hello!
i have a applet and i put it in a jar file with lots of many other classes.I need to know if i specify the applet archieve then how the applet will be downloaded ...as a whole jar file and then use the required classes or only required classes within the jar file..
can i put my app application applets and other classes in a single jar file and specify its path will all applet's archieve tag.
thank you for your help...
regards
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Satyendra,
The entire jar file is first downloaded by the client and then the class is used from it. You can put your files into one large jar file or many smaller ones and the browser will take care of it for you.
The usual way of doing it, assuming you have one jar file is to have the HTML source in the same directory as the JAR file and contain something like the following:
< APPLET CODE="mypackage.myclass" WIDTH=400 HEIGHT=500 ARCHIVE="myjar" >< /APPLET >
This way the code parameter points to the location inside the JAR file where myclass is located, and the archive tag just tells the browser which jar file to download.
Regards,
Manfred.
satyendra adhikari
Ranch Hand

Joined: Aug 17, 2001
Posts: 52
hello!!
thank you for your help..
i am developing a large intrernet application in applets with massive use of frames and beans.Since most frames and beans are used by various applets so should i pack all code in a single jar file and point to this jar in all html files..with respective main applet class file name.
i am afraid as the size of this jar will be very large..
please elaborate..
thank you
regards
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi,
Unfortunately since your applet requires all the supporting classes it doesn't matter if you pack them all into a single JAR or make many JAR files. They all must be downloaded to have your applet work correctly. Therefore, I would think it just come down to a maintanence issue ...
Regards,
Manfred.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: applet --jar confusion