Hi,
Right now I'm trying to create a Swing Frame with a Button and if i push a button, i want a jME-App to start.
And if i close the jME-App again i want it to switch back to the Swing-Frame, but I'm not quite sure how to do it…
Right now i start my game like this:
game = new StandardGame("Scrubs3D");
System.setProperty("jme.stats", "set");
game.start();
BasicGameState gameState = new BasicGameState();
GameStateManager.getInstance().attachChild(gameState);
gameState.setActive(true);
main = new Main(gameState.getRootNode(),game);
In the Class Main i create all my objects and so on.
So now i tried to just call the method above to start the game and when i press the button for the first time, it actually works, but when i close the jME-App and press the button again, i get the following Exception:
22.10.2008 20:04:53 class com.jme.system.lwjgl.LWJGLDisplaySystem initDisplay()
SCHWERWIEGEND: Exception
org.lwjgl.LWJGLException: X Error - disp: 0x85f2570 serial: 1469 error: BadGC (invalid GC parameter) request_code: 60 minor_code: 0
at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler(LinuxDisplay.java:286)
at org.lwjgl.opengl.LinuxContextImplementation.nCreate(Native Method)
at org.lwjgl.opengl.LinuxContextImplementation.create(LinuxContextImplementation.java:50)
at org.lwjgl.opengl.Context.<init>(Context.java:113)
at org.lwjgl.opengl.Display.create(Display.java:783)
at org.lwjgl.opengl.Display.create(Display.java:733)
at com.jme.system.lwjgl.LWJGLDisplaySystem.initDisplay(LWJGLDisplaySystem.java:422)
at com.jme.system.lwjgl.LWJGLDisplaySystem.createWindow(LWJGLDisplaySystem.java:143)
at com.jmex.game.StandardGame.initSystem(StandardGame.java:271)
at com.jmex.game.StandardGame.run(StandardGame.java:185)
at java.lang.Thread.run(Thread.java:636)
22.10.2008 20:04:53 com.jmex.game.DefaultUncaughtExceptionHandler uncaughtException
SCHWERWIEGEND: Main game loop broken by uncaught exception
com.jme.system.JmeException: Cannot create window: X Error - disp: 0x85f2570 serial: 1469 error: BadGC (invalid GC parameter) request_code: 60 minor_code: 0
at com.jme.system.lwjgl.LWJGLDisplaySystem.initDisplay(LWJGLDisplaySystem.java:440)
at com.jme.system.lwjgl.LWJGLDisplaySystem.createWindow(LWJGLDisplaySystem.java:143)
at com.jmex.game.StandardGame.initSystem(StandardGame.java:271)
at com.jmex.game.StandardGame.run(StandardGame.java:185)
at java.lang.Thread.run(Thread.java:636)
What do i have to change, so it works?
Thanks,
Dennis