From d9ec7858cdcddc3e90b423fc7c30b8e4e3edda42 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sun, 12 Jan 2025 16:27:53 +0000 Subject: [PATCH] fix(extract) run Swing code on the EDT --- .../extract/src/main/kotlin/org/lwjgl/extract/Main.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/extract/src/main/kotlin/org/lwjgl/extract/Main.kt b/modules/extract/src/main/kotlin/org/lwjgl/extract/Main.kt index 8666955f7c..228c015731 100644 --- a/modules/extract/src/main/kotlin/org/lwjgl/extract/Main.kt +++ b/modules/extract/src/main/kotlin/org/lwjgl/extract/Main.kt @@ -21,8 +21,6 @@ import javax.swing.event.* import javax.swing.plaf.basic.* fun main() { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()) - System.setProperty("line.separator", "\n") if (Configuration.LLVM_CLANG_LIBRARY_NAME.get() == null) { @@ -34,8 +32,12 @@ fun main() { } } - val app = Application() - app.frame.isVisible = true + SwingUtilities.invokeLater { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()) + + val app = Application() + app.frame.isVisible = true + } } private fun checkModal() = Window.getWindows().none { it is Dialog && it.isModal && it.isVisible }