*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.io.*;
-import org.altusmetrum.AltosLib.*;
-import org.altusmetrum.altosuilib.*;
+import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altosuilib_12.*;
public class MicroFileChooser extends JFileChooser {
JFrame frame;
return file;
}
- public InputStream runDialog() {
+ public File runDialog() {
int ret;
ret = showOpenDialog(frame);
- if (ret == APPROVE_OPTION) {
- file = getSelectedFile();
- if (file == null)
- return null;
- filename = file.getName();
- try {
- return new FileInputStream(file);
- } catch (FileNotFoundException fe) {
- JOptionPane.showMessageDialog(frame,
- fe.getMessage(),
- "Cannot open file",
- JOptionPane.ERROR_MESSAGE);
- }
- }
+ if (ret == APPROVE_OPTION)
+ return getSelectedFile();
return null;
}
setDialogTitle("Select MicroPeak Data File");
setFileFilter(new FileNameExtensionFilter("MicroPeak data file",
"mpd"));
- setCurrentDirectory(AltosUIPreferences.logdir());
+ setCurrentDirectory(AltosUIPreferences.last_logdir());
}
}