public void loadFile(int level){ try { //Create new file levelFile = new File("assets/levels.txt"); fis = new FileInputStream(levelFile); isr = new InputStreamReader(fis); reader = new BufferedReader(isr); //Code to read the file goes here Using this code, however, I keep getting the above error (java.io.FileNotFoundException).
The file definitely exists in my Assets folder and has the correct name. I've found a couple of similar questions on here and have tried various things including refreshing the project, cleaning the project, using "levels.txt" instead of "assets/levels.txt" but I keep getting this error.
Any ideas why?
URL. If the user, offer them aJFileChooser.