new MicroDownload(this, device);
}
- private void Save() {
- if (data == null) {
+ private void no_data() {
JOptionPane.showMessageDialog(this,
"No data available",
"No data",
JOptionPane.INFORMATION_MESSAGE);
+ }
+ private void Save() {
+ if (data == null) {
+ no_data();
return;
}
MicroSave save = new MicroSave (this, data);
SetName(data.name);
}
+ private void Export() {
+ if (data == null) {
+ no_data();
+ return;
+ }
+ MicroExport export = new MicroExport (this, data);
+ export.runDialog();
+ }
+
private void Close() {
setVisible(false);
dispose();
SelectFile();
else if ("Download".equals(ev.getActionCommand()))
DownloadData();
+ else if ("Export".equals(ev.getActionCommand()))
+ Export();
else if ("Preferences".equals(ev.getActionCommand()))
Preferences();
else if ("Save a Copy".equals(ev.getActionCommand()))
fileMenu.add(saveAction);
saveAction.addActionListener(this);
+ JMenuItem exportAction = new JMenuItem("Export");
+ fileMenu.add(exportAction);
+ exportAction.addActionListener(this);
+
JMenuItem preferencesAction = new JMenuItem("Preferences");
fileMenu.add(preferencesAction);
preferencesAction.addActionListener(this);