I'm pretty sure someone has already asked this but i Can't find it. How can I write to a text file so that when i build the project from netbeans it'll still be able to write the file when its built into the .jar.
I was also having a problem reading file to .jar but found out i could use InputStream
and BufferedReader
. Is there something that can do this but with writing?
This is what I was using:
printf=new PrintWriter(new File("Names.txt"));
but that doesn't work for writing outside of netbeans. Edit: The file is inside the classes of the jar file that I want to write to.