fileChooser.addChoosableFileFilter(filter);
fileChooser.setAcceptAllFileFilterUsed(true);
long start = System.nanoTime();
int option = fileChooser.showOpenDialog(null);
deadTime += System.nanoTime() - start;
fileChooser.dispose();
if (option != JFileChooser.APPROVE_OPTION) {
throw new StopRequestFromUserException();//if user give up, we give up too...
}
fileChooser.saveCurrentPath();//tell the file chooser to remember this location
outputFile = fileChooser.getSelectedFile();