String filename = File.separator+"tmp"; JFileChooser fc = new JFileChooser(new File(filename)); // Show open dialog; this method does not return until the dialog is closed fc.showOpenDialog(frame); File selFile = fc.getSelectedFile(); // Show save dialog; this method does not return until the dialog is closed fc.showSaveDialog(frame); selFile = fc.getSelectedFile();