Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

gilman824

First Java Applet Help

This topic is 5487 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I tried writing my first Java Applet a few days ago but for some reason I am getting the error message "load: class HelloWorld not found" when I try to run the HTML document. The HTML file is in the same directory as the HelloWorld.class file. For the HTML document the source is: <applet code="HelloWorld.class" width=400 height=50> </body> </html> and for the java file the source is: public class HelloWorld extends java.applet.Applet { public void paint (java.awt.Graphics g) { g.drawString("Hello, world!", 100, 25); } } does anyone know why it isn''t working?

Share this post


Link to post
Share on other sites
Advertisement
my file name is the same as the class name and i tried running it by typing the HTML source in notepad and saving it as HelloWorld.html then I tried running it.

Share this post


Link to post
Share on other sites
If youre using Internet Explorer im having the same problem and no one can figure it out...

[edited by - Mulligan on July 7, 2003 5:03:10 PM]

Share this post


Link to post
Share on other sites
If I use internet explorer it doesnt work but if I use appletviewer it does work. i hate when something should work but it doesnt.

Share this post


Link to post
Share on other sites
You should open the java console for Internet Explorer to see if an exception is being thrown. You can enabled it in your tools->internet options->advanced if it''s not enabled.

Another thing to check is the applet tag.

try this (with the codebase attribute):
<applet code="HelloWorld.class" width=400 codebase="." height=50>


also, make sure your class file in in the same path as your html file.

Also check here http://java.sun.com/docs/books/tutorial/applet/appletsonly/html.html, I personally thing it''s an applet tag problem.


Share this post


Link to post
Share on other sites
I changed the applet tag to what u gave me and it still didnt''t work. I enabled the java console but i dont know wut u mean by "see if an exception is being thrown"?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!