BurnTab bt;\r
Burn burn;\r
SummaryPanel sp;\r
- \r
+ JTextArea error;\r
JTabbedPane tabs;\r
\r
private Vector<BurnWatcher> burnWatchers = new Vector<BurnWatcher>();\r
\r
public void reBurn() {\r
removeAll();\r
+ if ( error != null ){\r
+ MotorEditor.this.remove(error);\r
+ error = null;\r
+ }\r
+ if ( sp != null ){\r
+ MotorEditor.this.remove(sp);\r
+ sp = null;\r
+ }\r
currentThread = new Thread() {\r
public void run() {\r
final Thread me = this;\r
- try {\r
+ try { \r
final Burn b = new Burn(motor);\r
b.addBurnProgressListener(\r
new Burn.BurnProgressListener() {\r
}\r
}\r
});\r
- if ( sp != null )\r
- MotorEditor.this.remove(sp);\r
+\r
MotorEditor.this.add(sp = new SummaryPanel(b), BorderLayout.NORTH);\r
revalidate();\r
b.burn();\r
});\r
} catch (BurnCanceled c){\r
log.info("Burn Canceled!");\r
- } catch (Exception e) {\r
- if ( sp != null )\r
- MotorEditor.this.remove(sp);\r
- JTextArea t = new JTextArea(e.getMessage());\r
- t.setBackground(Colors.RED);\r
- t.setForeground(Color.WHITE);\r
- t.setEditable(false);\r
- MotorEditor.this.add(t, BorderLayout.NORTH);\r
- revalidate();\r
+ } catch (final Exception e) {\r
+ SwingUtilities.invokeLater(new Thread() {\r
+ public void run() {\r
+ if ( sp != null )\r
+ MotorEditor.this.remove(sp);\r
+ error = new JTextArea(e.getMessage());\r
+ error.setBackground(Colors.RED);\r
+ error.setForeground(Color.WHITE);\r
+ error.setEditable(false);\r
+ MotorEditor.this.add(error, BorderLayout.NORTH);\r
+ revalidate();\r
+ }\r
+ });\r
}\r
}\r
};\r