Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Calling a JApplet Class in subfolder of a JAR

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 6448
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Saloon Keeper
Posts: 6448
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya i figured it out awhile after my previous reply. need to use "dot" to indicate package hierarchy. thanks!
 
Bring out your dead! Or a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic