have a project in java(a pacman game) which uses some external files, for example a .txt for the level design and some images for the pacman and ghosts. Right now i have them all under the project folder and access them as follows:
Scanner s = new Scanner(new File("level1.txt"));
image = ImageIO.read(new File("PM0.gif"));
The project works fine if i run it through eclipse, however when i export it to a .jar executable it wont load any file properly. What is the simplest way to have these resources properly packaged and loaded? I am new to java programming(this is my first project) and i got very confused from some previous answers to this question(and none of them worked).