- 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);
- }
- }