chooser.setCurrentDirectory(new File(txtFilename.getText()));
// We're only after directories, so set the chooser to only list directories
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
chooser.setMultiSelectionEnabled(false);
chooser.resetChoosableFileFilters();
chooser.setFileFilter(new FileNameExtensionFilter("Excel 2007 Files (*.xlsx)", "xlsx"));
chooser.addChoosableFileFilter(new FileNameExtensionFilter("Excel 97-2003 Files (*.xls)", "xls"));
chooser.addChoosableFileFilter(new FileNameExtensionFilter("CSV Files (*.csv)", "csv"));
int res = chooser.showOpenDialog(this);
if (res == JFileChooser.APPROVE_OPTION)
{
try
{