From: Bill Kuker Date: Mon, 8 Nov 2010 12:51:56 +0000 (+0000) Subject: Put error output on the top of the motor editor rather then on the results X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3e21ca7ca2a4d3e297fb36838e40b6c49926efbb;p=sw%2Fmotorsim Put error output on the top of the motor editor rather then on the results --- diff --git a/gui/com/billkuker/rocketry/motorsim/visual/workbench/MotorEditor.java b/gui/com/billkuker/rocketry/motorsim/visual/workbench/MotorEditor.java index 899b514..79c2545 100644 --- a/gui/com/billkuker/rocketry/motorsim/visual/workbench/MotorEditor.java +++ b/gui/com/billkuker/rocketry/motorsim/visual/workbench/MotorEditor.java @@ -1,6 +1,7 @@ package com.billkuker.rocketry.motorsim.visual.workbench; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -37,6 +38,7 @@ import org.jscience.physics.amount.Amount; import com.billkuker.rocketry.motorsim.Burn; import com.billkuker.rocketry.motorsim.Chamber; import com.billkuker.rocketry.motorsim.ChangeListening; +import com.billkuker.rocketry.motorsim.Colors; import com.billkuker.rocketry.motorsim.ConvergentDivergentNozzle; import com.billkuker.rocketry.motorsim.CylindricalChamber; import com.billkuker.rocketry.motorsim.Fuel; @@ -153,9 +155,14 @@ public class MotorEditor extends JPanel implements PropertyChangeListener { } catch (BurnCanceled c){ log.info("Burn Canceled!"); } catch (Exception e) { + if ( sp != null ) + MotorEditor.this.remove(sp); JTextArea t = new JTextArea(e.getMessage()); + t.setBackground(Colors.RED); + t.setForeground(Color.WHITE); t.setEditable(false); - add(t); + MotorEditor.this.add(t, BorderLayout.NORTH); + revalidate(); } } };