I wrote a java application which reads a file (files/olten) and displays the information in this file. (in a JTable). I now have problems with updating the information in the file so that the manipulations are not lost and on next opening of the program are still there.
I've tried many things to specify the path to the file but nothing worked. Here are some samples of what I tried:
out = new PrintWriter(new File("").getAbsolutePath() + "/files/olten");
out = new PrintWriter(this.getClass().getClassLoader().getResource("files/olten").toString());
out = new PrintWriter("olten");
the correct path (seen from the .java file's path) is "files/olten". How can I achieve to modify this file?
Thanks in advance!