[TASK] Fire up JFrames within awt thread.

This commit is contained in:
Jan Philipp Timme 2016-10-02 22:18:51 +02:00
parent 56957a0911
commit f9607a1a94
2 changed files with 16 additions and 4 deletions

View File

@ -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();
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.
}

View File

@ -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);
}
});
}
/**