JCheckBox delete;
public void actionPerformed(ActionEvent e) {
- System.out.printf("eeprom item action %s %d\n", e.getActionCommand(), e.getID());
if (e.getSource() == download) {
log.download = download.isSelected();
- System.out.printf("download for flight %d set to %b\n", log.flight, log.download);
} else if (e.getSource() == delete) {
log.delete = delete.isSelected();
- System.out.printf("delete for flight %d set to %b\n", log.flight, log.delete);
}
}
public AltosEepromItem(AltosEepromLog in_log) {
log = in_log;
- label = new JLabel(String.format("Flight #%02d - %04d-%02d-%02d",
- log.flight, log.year, log.month, log.day));
+ String text;
+ if (log.year != 0)
+ text = String.format("Flight #%02d - %04d-%02d-%02d",
+ log.flight, log.year, log.month, log.day);
+ else
+ text = String.format("Flight #%02d", log.flight);
+
+ label = new JLabel(text);
download = new JCheckBox("", log.download);
download.addActionListener(this);