When I view my Applet
using AppletViewer
, it looks fine. However, when I try to run it in Safari, it doesn't show up. Same problem with Chrome, Firefox, and Opera.
Here's my Java code:
import java.awt.*;
import javax.swing.JApplet;
public class WelcomeApplet extends JApplet
{
public void paint(Graphics g)
{
super.paint(g);
//setSize(500, 190);
g.setColor(Color.red);
g.drawString("Welcome to Java applet programming!", 30, 30);
g.setFont(new Font("Courier", Font.BOLD, 24));
g.drawString("Courier bold 24pt font", 30, 36);
g.setFont(new Font("Arial", Font.PLAIN, 30));
g.drawString("Arial plain 30pt font", 30, 70);
g.setFont(new Font("Dialog", Font.BOLD + Font.ITALIC, 36));
g.drawString("Dialog italic bold 36pt font", 30, 110);
g.setFont(new Font("Serif", Font.ITALIC, 42));
g.drawString("Serif italic 42pt font", 30, 156);
}
}
And here's my HTML:
<HTML>
<HEAD>
<TITLE>Welcome Applet</TITLE>
</HEAD>
<BODY>
<OBJECT CODE="WelcomeApplet.class" WIDTH="440" HEIGHT="50">
</OBJECT>
</BODY>
</HTML>
Everything compiles fine. All of my files are in the same directory on my computer. There's nothing showing up in the Java console.
Thanks for any help!
EDIT: Suggested question does not address problem