Closed DaMatrix closed 3 years ago
well, in my case i'm launching the converter GUI from inside minecraft... i guess that's not really an expected use case though, so feel free to not merge if this is out-of-scope.
Running the GUI in MC... that seems very wrong. But also, wrapping it in EventQueue.invokeLater should already be enough to make it not block
i considered that, but figured there was some reason why you added the Thread.sleep()
to keep the main thread alive. would doing that actually be safe?
The reason I added the Thread.sleep() is that when I was initially writing the code, the JVM I ran it on probably had a bug where it would shut down the event loop thread and quit even after calling EventQueue.invokeLater if the main thread quit.
Or you could just call EventQueue.invokeLater(() -> new GuiFrame().init());
yourself and make the change unnecessary. If you are shading the dependency into your jar, you probably won't care about forward version compatibility.
And that way you also avoid running the risk of silently triggering headless mode on weird JVMs
true, alright then. closing.
Why is that needed? I don't think you should need to run the GUI in any situation where blocking may matter