LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: lwjuggler on December 16, 2011, 20:04:53

Title: swing gui freezes after LWJGL Display destroy
Post by: lwjuggler on December 16, 2011, 20:04:53
Hi all,

         i am developping a map editor with Swing. The gui is a BorderLayout and in the middle of it, I use a Display to display the game preview. So i include a Display in the gui with Display.setParent() method. When I encounter a problem, an exception while the game is running, I catch it and try to do the game continue, but it is impossible. So i tried to destroy the Display ant recreate it to have a clean nex OpenGl thread. The game preview works, it restarts, but, the swing GUI freezes ...
Does anyone has an explanation ?
Title: Re: swing gui freezes after LWJGL Display destroy
Post by: CodeBunny on December 17, 2011, 14:12:09
You restarted it in the AWT execution thread, I'm guessing, instead of spinning off a new thread. The AWT execution thread is suddenly working on updating your game, and devotes no time to processing GUI activity.

You have two ways of solving this, and one is much better than the other.