Hi all,

I am trying to write to a text file in my program, which is packaged as a jar file. To read from files, I use
Java Code:
getClass().getResourceAsStream(fileName)
which returns an input stream, but I can't find any way to get an output stream that works in a jar file. An example of some code which works in eclipse but not in the jar packaging is:
Java Code:
URL url = getClass().getResource(fileName);
PrintWriter writer = new PrintWriter(url.getPath());
Please help me!