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!

why doesn't applet run in all browsers?

843807Oct 16 2008 — edited Oct 28 2008
Hello, I am trying to embed an applet in my webpage so people can see the applet. The aim is that anybody with any browser, with any settings, can see the applet. I thought, (this is what I was taught in school anyway) this is the whole idea behind applets - they cannot touch your computer's data, therefore, if you open a browser, any browser, you can see any applet.

Not so, I have a simple applet that only prints "foo". In IE7, I have to enable "Run ActiveX Controls and Plug-ins", to see it. In Firefox, I don't see it at all, with any settings. Who knows what happens with other browsers???

What is going on?? Why is this so hard to have anybody see a simple applet?? Again, I thought this was the whole idea behind Java and applets, run on everything, no download needed, just go a website and see the applet.... What am I missing??

Mark


Code is simple, nothing to it. The source is foo.java, I compile it to make foo.class, and embed that in index.html.

foo.java:

import javax.swing.*;
import java.awt.*;


public class foo extends JApplet
{
public void paint(Graphics g)
{
g.drawString("foo", 0, 100);
}
}



index.html:
<OBJECT
codetype="application/java"
code=foo.class
width=512 height=512
>

<PARAM NAME="cache_option" VALUE="No">

</OBJECT>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2008
Added on Oct 16 2008
2 comments
247 views