I am having trouble embedding a super simple applet into my website. When I open the page, the console on the bottom bar says "Applet TestApplet notloaded" and the text "Error. Click for details" in the space where the applet should run. I used filezilla to push the html and .class file to "http://nuevawave.org/sandbox/JavaGallery/". The html file is called Test.html . The applet works fine when I run it from netbea开发者_开发百科ns.
Here is the html:
<html>
<head>
<title>Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
words...
<applet codebase ="http://nuevawave.org/sandbox/JavaGallery/" code="TestApplet.class" width="250" height="300" />
</body>
</html>
..Clicking the details button opens the java console, but no errors are present.
My version of FF is more informative.
...
Exception: java.lang.NoClassDefFoundError: TestApplet
(wrong name: test/TestApplet)
This indicates the applet is in the package test
, and should therefore be located at..
http://nuevawave.org/sandbox/JavaGallery/test/TestApplet.class
At the moment it is here..
http://nuevawave.org/sandbox/JavaGallery/TestApplet.class
Edit 1
After more snooping around that site, I threw the following together.
HTML
Put this HTML at http://nuevawave.org/sandbox/JavaGallery/applet.html
<html>
<body>
<applet
codebase="."
archive="TestApplet.jar"
code="test.TestApplet2"
width="250"
height="300">
</applet>
</body>
</html>
Output
I freaking love computers!
精彩评论