Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Simple HTML question. How do i view an applet in a browser?

843807Apr 2 2008 — edited Apr 2 2008
I'm trying to make an applet, and when I test it in Eclipse it works and display a little bit of text I put in it. But when I try to put it in a browser it doesn't work. I know I have the correct plug-ins because I've used Java applets on the internet before.
This is the code I'm using in the html. It is directly out of a Java book I'm reading.
<html>
<body>
Applet Test.
<APPLET code="AppletTest" width=100 height=100>
Sorry, your browser isn't able to run Java applets.</APPLET>
</body>
</html>
I don't understand how it would find this applet test file. I made the file and after compiling it was called AppletTest.class, but I don't know where to put it so this HTML code will find it. I also have another book on Java that contradicts this code saying it should be:
<html>
<body>
Applet Test.
<APPLET code=AppletTest.class width=100 height=100>
Sorry, your browser isn't able to run Java applets.</APPLET>
</body>
</html>
Which is a little different, but is still really confusing.
Can anyone please set this straight for me?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2008
Added on Apr 2 2008
2 comments
120 views