problem with making an applet

Hi to everyone. I’m trying to port my application to an applet. I did a basic application which works well as standalone. I can even start it from the command line so I suppose I’ve set up my classpath correctly. As a stand alone app I inherit from JFrame and have a public static void main method. To make it an applet I just changed the inheritance to JApplet, deleted the super call in the constructor and the setDefaultCloseOperation and added a public void init where I copied the contents of main:

pubic void init()
{
final Main app = new Main();
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
app.setVisible(true);
}
}
);
}

But still the app refuses to run as an applet. Also, the .htm file, should be in the folder with the classes (they’re inside a package) or on the previous folder? The error I get on the java console in the browser is class def not found for GLEventListener. Any ideas? Any tutorials as running opengl programs as applets?

Are you sure you are using the same jre for commandline and browser?

// Gregof

Thanks for the advice. I didn’t know that the sdk actually install 2 jre’s, one inside the SDK folder and the other in a jre folder of its own. So now, I’m getting a different kind of error, if someone can ellaborate:

java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
etc. etc.

I guess I have to sign my applet or something? How do I do that? Thanks for the help and again, sorry for the silly questions, but I’m only studying java for a few weeks.