Java Applet Won't Initialize
843807Jan 24 2008 — edited Feb 7 2008This is a modified version of a tutorial I've been working with. Code for Main.java:
import javax.swing.*;
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame f = new JFrame("Swing Paint Demo");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(300,300);
f.setVisible(true);
}
});
}
}
Problem is that when I try to load the applet into an html file:
<html>
<APPLET code="Main.class"></APPLET>
</html>
It doesn't load.
The file compiles and executes as a stand alone .jar, but when I try to run it as an applet it won't work.
I know I'm probably missing an easy step. I have already checked my IE7 settings and java is enabled. I have no problem with any other java applets, just the ones I make. haha. Thank you ahead of time.