public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
boolean success = e.getID() != 0;
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
boolean success = e.getID() != 0;
System.out.printf("Eeprom manager action %s %d\n", cmd, e.getID());
if (cmd.equals("download")) {
if (success) {
System.out.printf("Eeprom manager action %s %d\n", cmd, e.getID());
if (cmd.equals("download")) {
if (success) {
serial_line.device.toShortString(),
JOptionPane.INFORMATION_MESSAGE);
}
serial_line.device.toShortString(),
JOptionPane.INFORMATION_MESSAGE);
}
}
} catch (FileNotFoundException ee) {
JOptionPane.showMessageDialog(frame,
}
} catch (FileNotFoundException ee) {
JOptionPane.showMessageDialog(frame,
device.toShortString(),
ee.getLocalizedMessage(),
JOptionPane.ERROR_MESSAGE);
device.toShortString(),
ee.getLocalizedMessage(),
JOptionPane.ERROR_MESSAGE);
} catch (TimeoutException te) {
JOptionPane.showMessageDialog(frame,
String.format("Communications failed with \"%s\"",
device.toShortString()),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} catch (TimeoutException te) {
JOptionPane.showMessageDialog(frame,
String.format("Communications failed with \"%s\"",
device.toShortString()),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);