Dear Friends, I have made a GUI which has a TextArea. Am trying to write the contents of the TextArea into a file using FileOutputStream. It is writing but every new line entry is replaced by a rectangular like structure and is not writing to a new line. Could you please explain and help me out of this.
Windows uses two characters, a carrage return and a line feed, to indicate a line. You should use BufferedWriter to write your file, as it is text (Streams are used for binary data) and that class provides a handy newLine() method to relieve you from the responsability of keeping track of which platform recognizes which line format.