So I made an Applet (not JApplet) and proceeded to upload it to my website. I put all of my .class files into a package, exported the project from eclipse to a .jar, and uploaded that to the public_html folder of my website.
In my HTML code, I put
<applet ARCHIVE="BallShooter.jar" CODE="BallShooter" width=500 height=500> </applet>
However, it seems that I kept on getting the error "ClassNotFoundException" If I reupload the .jar WITHOUT the package, it worked fine. Could somebody please explain to me how to fix this?
For those who are wondering, this is the structure of the things in the website
/public_html/myAppletJar/myPackage/a.class
/public_html/myAppletJar/myPackage/b.class
/public_html/myAppletJar/a.png
/public_html/myAppletJar/b.png
Check all these points:
BallShooter
, and is in the package kikiotsuka
, then its source code must start with the line package kikiotsuka;
. The full name of the class is thus kikiotsuka.BallShooter
.kikiotsuka
at the root, and this directory must contain a file named BallShooter.class
kikiotsuka.BallShooter
, that's what the code attribute of the applet HTML element must contain: code="kikiotsuka.BallShooter" width=...