String askForDumpFilename() { int returnVal = sqlSaveChooser.showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = sqlSaveChooser.getSelectedFile(); System.out.println("Selected dump file " + file.getAbsolutePath()); // return file.getName(); return file.getAbsolutePath(); } else { System.out.println("Save command cancelled by user."); } return null; }
void initializeSaveChooser(String filename) { sqlSaveChooser = new FileExistsAwareFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter("SQL Dokumente", "sql"); sqlSaveChooser.setFileFilter(filter); sqlSaveChooser.setSelectedFile(new File(filename)); }