du kan jo prøve at til true som argument i
FileWriter fw = new FileWriter(f);
altså:
FileWriter fw = new FileWriter(f, true);
jeg har ikke testet det men javadoc'en siger:
FileWriter
public FileWriter(File file,
boolean append)
throws IOExceptionConstructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
Parameters:
file - a File object to write to
append - if true, then bytes will be written to the end of the file rather than the beginning
Throws:
IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
Since:
1.4
hilsen
Troels
Indlæg senest redigeret d. 09.12.2006 21:30 af Bruger #2967