Starting up JME in applet in a non-inheriting class

Hello, I am trying to start JME after my program has been running for awhile. So the way I'm doing it is, the actual game is launched by a handler class (in this case MainMap). The problem is the SimpleJMEApplet extends Applet and does some magic voodoo where the scene is actually implemented by the implementor.



If you look at the code in SimpleJMEApplet, the init method is overriding the Applet init method and does some basic setup. I would say the most important part is the following:



           

glCanvas = (Canvas)DisplaySystem.getDisplaySystem().createCanvas(canvasWidth, canvasHeight);

          // Important! Here is where we add the guts to the canvas:

            impl = new SimpleAppletCanvasImplementor(getWidth(), getHeight());



            ((JMECanvas) glCanvas).setImplementor(impl);

            setLayout(new BorderLayout());

            add(glCanvas, BorderLayout.CENTER);




My code looks like this. This is placed in an init method of the MainMap class which is called at some point after a bunch of network code is executed…


public class MainMap {
private final Main main = Main.getInstance(); //Main is the main class and extends Applet. The init method in main starts the program but the constructor in main sets a private static instance variable to itself, see bottom of this

public void init() { //called when needed after network code, game start etc
            //code copied from SimpleJMEApplet etc...
            glCanvas = (Canvas)DisplaySystem.getDisplaySystem().createCanvas(WIDTH, HEIGHT);
            // Important! Here is where we add the guts to the canvas:
            impl = new SimpleAppletCanvasImplementor(WIDTH, HEIGHT);

            ((JMECanvas) glCanvas).setImplementor(impl);
            main.add(glCanvas, BorderLayout.CENTER);
            //more code copied from SimpleJMEApplet etc...
}
}


So as far as I can tell, when the glCanvas is added to the Applet panel, the applet somehow manages to call the doSetup() method of the SimpleCanvasImpl which pretty much does all the magic because its assigned to the glCanvas... Manually calling it in the init method throws an exception. Obviously the applet is actually calling something of glCanvas but you know what I mean. Thanks for your help!

Oh here is the constructor of main which is called by the applet initializer:


public Main() {
remoteBrowser = RemoteBrowser.getInstance();
remoteBrowser.setMain(this);
instance = this;
}


I know it's like a ghetto Singleton, but I'm not going to mass to every single class that needs access to it.

I have another question. I've read that when JME runs in an Applet it relies AWT for it's input. Could you elaborate? I'm not too famliar with AWT. My guess is something along the lines of that Java doesnt have any reference of the mouse or keyboard except through the provided AWT interface on which the APplet is based?



The main reason I ask is about GUI developement. I'm guess because of this, it would be a good idea to use AWT for the GUI since the mouse mousemovements etc wouldn't have to through another interface, right?