Applet in fullscreen mode

Hi everyone,



I've been doing some experiments with applets and I've managed to get pretty much what I wanted so far… however I still have a major issue: I'm not able to set my applet to fullscreen.



I know that it's possible to do it because I've seen it (in Runescape) and I actually have working code of a LWJGL that does it (the Gears applet code, included in LWJGL2.0).



The code in LWJGL Gears uses Display.setFullscreen. I've tried simply setting Display.setFullscreen on my applet, but I go nothing whatsoever.



I then proceeded to some creative thinking… the applet creates a full screen frame and then sets the canvas to it:



Frame fr = new Frame();

        fr.setResizable(false);

        if (!fr.isDisplayable()) fr.setUndecorated(true);

        GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();       

        gd.setFullScreenWindow(fr);

        fr.setVisible(true);

        fr.add(canvas);





If this is done in the init method (before the applet is visible) everything goes smoothly and I have a full screen applet. However, when I do it while running the applet I get:





Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException

at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:297)

at org.lwjgl.opengl.AWTGLCanvas.update(AWTGLCanvas.java:321)

at sun.awt.RepaintArea.updateComponent(Unknown Source)

at sun.awt.X11.XRepaintArea.updateComponent(Unknown Source)

at sun.awt.RepaintArea.paint(Unknown Source)

at sun.awt.X11.XComponentPeer.handleEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)





I've tried everything to get this working (stopped rendering, created a thread that stops the applet's process and tries to switch the canvas, etc).





This should be possible to do, since LWJGL Gears uses an AWT canvas, which is what JME ends up rendering to.



Can anyone help me out on this? This is fulcral to the project I'm involved in.



Best regards,

Alex


Any progress with this? I'm trying to do the same thing and having limited success - using the frame method proposed I can make it fullscreen during init - but it fails miserably if I try to change it once it's started rendering.