X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosIgniteUI.java;h=b215c22865604fd0631109e5b03b6ecd8000f6df;hp=42120b92d0250d7124d0cccb2adcdcd7ab9c5650;hb=74d5dea5d5ef91db823018b631613d15c6da085d;hpb=e3bf13a38d24e95b16df1e2f01952d10f24cda10 diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java index 42120b92..b215c228 100644 --- a/altosui/AltosIgniteUI.java +++ b/altosui/AltosIgniteUI.java @@ -43,6 +43,7 @@ public class AltosIgniteUI JToggleButton arm; JButton fire; javax.swing.Timer timer; + JButton close; int apogee_status; int main_status; @@ -121,8 +122,7 @@ public class AltosIgniteUI void ignite_exception(Exception e) { if (e instanceof FileNotFoundException) { JOptionPane.showMessageDialog(owner, - String.format("Cannot open device \"%s\"", - device.toShortString()), + ((FileNotFoundException) e).getMessage(), "Cannot open target device", JOptionPane.ERROR_MESSAGE); } else if (e instanceof AltosSerialInUseException) { @@ -340,8 +340,8 @@ public class AltosIgniteUI c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.CENTER; c.insets = i; - c.weightx = 1; - c.weighty = 1; + c.weightx = 0; + c.weighty = 0; c.gridx = 0; c.gridy = 0; @@ -402,6 +402,15 @@ public class AltosIgniteUI fire.addActionListener(this); fire.setActionCommand("fire"); + c.gridx = 0; + c.gridy = 4; + c.gridwidth = 2; + c.anchor = GridBagConstraints.CENTER; + close = new JButton ("Close"); + pane.add(close, c); + close.addActionListener(this); + close.setActionCommand("close"); + pack(); setLocationRelativeTo(owner);