Skip to content
Snippets Groups Projects
Commit 8af2df6b authored by Anian Bühler's avatar Anian Bühler
Browse files

stopped sim and gui threads on exit

parent 1bb046e4
No related branches found
No related tags found
1 merge request!1Dev sim type float
......@@ -6,6 +6,8 @@ package tec.letsgoing.ardublock.simulator;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Vector;
import javax.swing.UIManager;
......@@ -104,6 +106,15 @@ public class Simulator implements Runnable, ActionListener{
guiThread = new Thread(gui);
guiThread.start();
//override close operation
//TODO: TEST
gui.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
instance.stopSimu();
gui.stopThread();
}
});
return true;
}
......
......
......@@ -433,11 +433,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
// e.printStackTrace();
}
super.repaint();
}
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment