altosui: Output recorded clock tick in CSV files
[fw/altos] / altosui / AltosScanUI.java
index bce4b32c9ef02e19db030e33eb77a5e5a2558005..e188834e64aa76a204d8026a42324273b800c29a 100644 (file)
@@ -102,7 +102,7 @@ class AltosScanResults extends LinkedList<AltosScanResult> implements ListModel
 }
 
 public class AltosScanUI
-       extends JDialog
+       extends AltosDialog
        implements ActionListener
 {
        AltosUI                         owner;
@@ -130,8 +130,7 @@ public class AltosScanUI
        void scan_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) {
@@ -326,8 +325,7 @@ public class AltosScanUI
                        return true;
                } catch (FileNotFoundException ee) {
                        JOptionPane.showMessageDialog(owner,
-                                                     String.format("Cannot open device \"%s\"",
-                                                                   device.toShortString()),
+                                                     ee.getMessage(),
                                                      "Cannot open target device",
                                                      JOptionPane.ERROR_MESSAGE);
                } catch (AltosSerialInUseException si) {