0

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

2 Answers 2

2

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
Sign up to request clarification or add additional context in comments.

Comments

0

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:

  • rocketman.jar
    • com
      • neelsonmani
        • rocketman
          • RocketMan$1.class
          • RocketMan.class
          • RocketMan$2.class
          • RocketMan$Meteor.class

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.