The JFileChooser.getSelectedFile() will return the file selected by the user.

java memory