Program crashes when starting an external application after displaying a canvas

Hey guys, :slight_smile:
I’m using a custom launcher in Swing where the players can log in, view their profiles etc. When starting the actual game, a SimpleApplication is created and started using the standard way:

simpleApplication.start();

(Started as window)

This works just fine. Now I thought about adding a cool login screen to the swing client with a jME canvas and a little animation:

loginScreenApplication = new LoginScreenApplication(this, loginScreen); //it's just a basic simpleapplication with a few models
loginScreenApplication.createCanvas();
JmeCanvasContext jmeCanvasContext = (JmeCanvasContext) loginScreenApplication.getContext();
jmeCanvasContext.setSystemListener(loginScreenApplication);
add(jmeCanvasContext.getCanvas()); //the canvas is added to a JPanel and displaye

It’s started by calling:

loginScreenApplication.startCanvas();

After closing the login screen (I even tried to remove the canvas from the parent and/or call loginScreenApplication.stop()) and starting another SimpleApplication as external window (as described above), the program crashes with the following error:

Apr 02, 2014 6:45:37 PM com.jme3.app.Application handleError Schwerwiegend: Failed to create display org.lwjgl.LWJGLException: Parent.isDisplayable() must be true at org.lwjgl.opengl.Display.createWindow(Display.java:301) at org.lwjgl.opengl.Display.create(Display.java:848) at org.lwjgl.opengl.Display.create(Display.java:757) at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:140) at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:113) at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207) at java.lang.Thread.run(Thread.java:722)

Apr 02, 2014 6:45:37 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run
Schwerwiegend: Display initialization failed. Cannot continue.


The error has to be related to OpenGL, I guess there’s something not “cleaned up” properly after closing and stopping the canvas application. I hope you understand the problem and sorry for the title: The 80 max characters weren’t enough to describe the whole thing precise enough^^

Yours, destro :slight_smile:

EDIT: I’ll look into creating a test case with a minimized swing gui and applications, if I have the time the next days.

I suggest if you use a launcher already, to maybee split both applications, and start the 3d one with processbuilder, the gain would be to be able to send crashreports and logs from the launcher. You could even put both in the same jar, just start one main normally, and let the launcher start the other.

Problem is still there, no other thoughts? Of course, I could use 2 different applications, but that doesn’t fix the initial problem.
I think this is a bug that should be fixed and not worked around.