X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=micropeak%2FMicroFileChooser.java;h=21ddb0f85e5f990cf73db79d72cf07f164817bc4;hb=f20781010a6560b7b359af269c502d098917c446;hp=d254098783bb509da82dc7bbfcb6baa12cc0cd7b;hpb=36e9603f74b85776ac049758021b51909161aeb1;p=fw%2Faltos diff --git a/micropeak/MicroFileChooser.java b/micropeak/MicroFileChooser.java index d2540987..21ddb0f8 100644 --- a/micropeak/MicroFileChooser.java +++ b/micropeak/MicroFileChooser.java @@ -36,24 +36,12 @@ public class MicroFileChooser extends JFileChooser { 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; }