- label = new JLabel(String.format("Flight #%02d - %04d-%02d-%02d",
- log.flight, log.year, log.month, log.day));
- label.setPreferredSize(new Dimension(170, 15));
- add(label);
- download = new JCheckBox("", log.download);
- download.addActionListener(this);
- download.setPreferredSize(new Dimension(100, 15));
- download.setHorizontalAlignment(SwingConstants.CENTER);
- add(download);
- delete = new JCheckBox("", log.delete);
- delete.addActionListener(this);
- delete.setPreferredSize(new Dimension(70, 15));
- delete.setHorizontalAlignment(SwingConstants.CENTER);
- add(delete);
+ 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);
+
+ action = new JCheckBox("", log.selected);
+ action.addActionListener(this);