File Input - Signed JAR Applet
Hello, I have been having quiet some trouble trying to solve my problem.
I have a type of game applet that I have been developing.
In the long run, the applet is going to be hosted on my server in an HTML file.
The applet is compressed into a JAR along with all the files and images needed.
I am trying to open a text file that is in the JAR, read it, and use the content accordingly.
When I test the signed JAR applet locally on my machine, in an HTML file, it works flawlessly every time.
When I upload the signed JAR to my server and then try to load it in an HTML file, it throws a "File Not Found" exception.
All the other images load, they are also compressed in the JAR.
I even tried placing copies of the file outside of the jar in the same directory, and still no luck.
My objective is to be able to have the applet hosted on my web server, and it be able to find the file that is either compressed in the JAR, or located in the same directory as the applet.
My code to open the "file".
File file = new File("level1.txt");
Scanner scanner = new Scanner(file);