How are you getting the path to the file you want to read? Are you using the JFileChooser or the File classes?