Writing to a text file *Resolved*
This section of code writes the contents of a variable to a text file:
Code:
//writes contents of TADisplay to a text file
try {
File File2 = new File("applications.txt");
FileOutputStream outpFile2 = new FileOutputStream(File2);
DataOutputStream outp = new DataOutputStream(outpFile2);
{
outp.writeUTF(s); }
outp.close();
}
catch (IOException ex) {
System.out.println(ex);
}
that works fine - but what i wish to do now is next time the application runs, save the next contents of the variable AS WELL as the one that is already in the text file. At the moment it overwrites it.
Any suggestions?