Reputation: 595
I'm using Eclipse for my code, and my package name is com.neelsomani.rocketman.
I'm not sure how to properly upload my Java applet. So far I have two classes in the same .java. I compile my code, then look in bin/com/neelsomani/rocketman
. There are four .class
files there. There is RocketMan$1.class
, RocketMan.class
, RocketMan$2.class
, and RocketMan$Meteor.class
.
I tried uploading all of these to my website but it didn't work. I used RocketMan.class
for the code attribute of the applet tag. Here is the link to the page: http://www.theawesomenesssite.com/applet/rocketman.php.
You can view the way I uploaded the files here: http://www.theawesomenesssite.com/applet/.
I keep my images
folder in the bin
folder on my Mac and it runs fine. Is there some place that I should be putting the folder on my site?
Thanks.
Neel
Upvotes: 0
Views: 945
Reputation: 74750
If you don't want to upload the .class
files individually (and the browser/plugin download them individually), you could also put them in a jar file, in the directory structure given by the package structure, like this:
For the images, you can put them in the same jar file - but make sure you load them in the applet with Class.getRessource() or related functions, not as a file.
Then use the archive
attribute for your <applet>
tag.
Upvotes: 0
Reputation: 8677
you've specified the classname incorrectly. Needs to be the fully qualified name ie. include the package and class name. It expects the class name, not the class filename
<applet width=400 height=400 code="com.neelsomani.rocketman.RocketMan"> </applet>
You also need to upload the class files (you need all of them) in the same directory structure as the package path. So in your case your classes should be in
http://www.theawesomenesssite.com/applet/com/neelsomani/rocketman
Upvotes: 2