This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Applets and the fly likes Calling a JApplet Class in subfolder of a JAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Calling a JApplet Class in subfolder of a JAR" Watch "Calling a JApplet Class in subfolder of a JAR" New topic
Author

Calling a JApplet Class in subfolder of a JAR

Vincent Oh
Ranch Hand

Joined: Jan 02, 2012
Posts: 33
Both my HTML and JAR file are in the same folder.



My JAR file hierarchy:
Tester3/HelloApplet1.class
HelloApplet.class
META-INF/Manifest.mf

I can call HelloApplet.class with no problem but for the one inside Tester3 folder, I cant seems to be able to reach it. Any help? Thanks in advance.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
The only way to make it work is if the HelloApplet1 clas is in package called "Tester3". Otherwise there's no way.
Vincent Oh
Ranch Hand

Joined: Jan 02, 2012
Posts: 33
Tim Moores wrote:The only way to make it work is if the HelloApplet1 clas is in package called "Tester3". Otherwise there's no way.


It is already define with package Tester3. I export the class file from Eclipse. Just that I do not know how to script the HTML for it to target the subfolder in a Jar file.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
like this:

... code="Tester3.HelloApplet1.class" ...

See http://docs.oracle.com/javase/1.4.2/docs/guide/misc/applet.html and http://docs.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/contents.html for everything you need to know about deploying applets.
Vincent Oh
Ranch Hand

Joined: Jan 02, 2012
Posts: 33
Ya i figured it out awhile after my previous reply. need to use "dot" to indicate package hierarchy. thanks!
 
wood burning stoves
 
subject: Calling a JApplet Class in subfolder of a JAR
 
Similar Threads
Applet jar file,use of archive in applet help
Applet not loading
another kind of Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
Cannot load applet
Deploy applet in Tomcat