diff --git a/src/main/java/lu/jpt/csparqltest/Main.java b/src/main/java/lu/jpt/csparqltest/Main.java index 03f3373..b8cda92 100644 --- a/src/main/java/lu/jpt/csparqltest/Main.java +++ b/src/main/java/lu/jpt/csparqltest/Main.java @@ -25,9 +25,15 @@ public class Main { PropertyConfigurator.configure("/log4j.properties"); } // Initialize SimulationContext and wire it up with its control window - SimulationContext simulationContext = new SimulationContext(); - @SuppressWarnings("unused") - SimulationControlWindow simulationControlWindow = new SimulationControlWindow(simulationContext); + final SimulationContext simulationContext = new SimulationContext(); + // Fire up the control window + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + @SuppressWarnings("unused") + SimulationControlWindow simulationControlWindow = new SimulationControlWindow(simulationContext); + } + }); + // That's it, the program is now basically running on its own. } diff --git a/src/main/java/lu/jpt/csparqltest/util/WindowLoggingRdfStream.java b/src/main/java/lu/jpt/csparqltest/util/WindowLoggingRdfStream.java index 5bbbb45..12eb8ae 100644 --- a/src/main/java/lu/jpt/csparqltest/util/WindowLoggingRdfStream.java +++ b/src/main/java/lu/jpt/csparqltest/util/WindowLoggingRdfStream.java @@ -13,7 +13,13 @@ public class WindowLoggingRdfStream extends LoggableRdfStream { public WindowLoggingRdfStream(String iri) { super(iri); - this.observerWindow = new TextObserverWindow("[RdfStream] "+iri); + // Fire up the window + final WindowLoggingRdfStream me = this; + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + me.observerWindow = new TextObserverWindow("[RdfStream] "+iri); + } + }); } /**