Does the code call the write() method? What is returned by the getText() method? Add a println to print out the String returned by getText() so you can see what is returned.
Is the file closed...