LwjglCanvas Hangs When I Try to Quit Application

Anything libgdx related goes here!

LwjglCanvas Hangs When I Try to Quit Application

Postby tommiller » Sun Aug 11, 2019 9:06 pm

Hello,

I use LwjglCanvas to render my libgdx game in a Swing GUI. The thing is when I quit app using close icon on Desktop, app hangs forever.
As stated in LwjglCanvas documentation I used stop before closing my app.

Code: Select all
jFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

jFrame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent e) {
      lwjglCanvas.stop();
      System.exit(0);
   }
});


The program doesn't respond at all and waits forever (or until I use Ctrl+Alt+Delete to close it forcefully!). Please help.
tommiller
 
Posts: 15
Joined: Sat Jan 20, 2018 6:54 pm

Re: LwjglCanvas Hangs When I Try to Quit Application

Postby shatterblast » Mon Aug 12, 2019 5:03 am

LibGDX really does not work well with Swing. Really old versions do, like maybe 1.0 and before, but those are not supported. You can search in this forum for other posts that mention "Swing" as to why.
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm


Return to Libgdx

Who is online

Users browsing this forum: No registered users and 1 guest