Can you post the code that reads from the file? What you have posted in post#1 does not read anything.

Read the API doc for the PrintWriter class to see what that class does.
Java Platform SE 7