public void browseForFile() {
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setAcceptAllFileFilterUsed(true);
        String extension = this.editedOption.getDefaultFileExtension();
        if (extension != null) {
            fileChooser.addChoosableFileFilter(new FileExtensionFilter(
                    extension));
        }
        fileChooser.setSelectedFile(new File(this.textField.getText()));
        if (this.editedOption.isOutputFile()) {
            if (fileChooser.showSaveDialog(this.browseButton) == JFileChooser.APPROVE_OPTION) {
                File chosenFile = fileChooser.getSelectedFile();
                String fileName = chosenFile.getPath();
                if (!chosenFile.exists()) {
                    if ((extension != null) && !fileName.endsWith(extension)) {
                        fileName = fileName + "." + extension;
                    }
                }
                this.textField.setText(fileName);
            }
        } else {
            if (fileChooser.showOpenDialog(this.browseButton) == JFileChooser.APPROVE_OPTION) {
                this.textField.setText(fileChooser.getSelectedFile().getPath());
            }
        }
    }