public static File selectFileFromDialog(Component parent, String startPath, boolean showAllFiles) {
        if (startPath == null || parent == null) {
            throw new IllegalArgumentException("The arguments may not be null.");
        }

        LookAndFeel originalLookAndFeel = UIManager.getLookAndFeel();
        setLookAndFeelToNimbus();
        File startFile = new File(startPath);
        JFileChooser dialog = new JFileChooser(startFile);

        if (startFile.isFile()) {
            dialog.setSelectedFile(startFile);
        }

        if (!showAllFiles) {
            dialog.setFileFilter(new FileFilter() {
                @Override
                public boolean accept(File file) {
                    return file != null && (file.isDirectory() || file.getAbsolutePath().matches(".*\\.csv"));
                }

                @Override
                public String getDescription() {
                    return "*.csv";
                }
            });
        }

        dialog.setMultiSelectionEnabled(false);
        dialog.setMinimumSize(MINIMUM_SIZE);
        dialog.setPreferredSize(PREFERRED_SIZE);
        dialog.showOpenDialog(parent);
        File file = dialog.getSelectedFile();

        setLookAndFeel(originalLookAndFeel);

        return file;
    }