Writing to a text file, then appending to it

I need to write a heading in a text file and then append text after this e.g:

heading

--

text1

text2

At the moment what i get is:

heading

-

text1

heading

--

text2

publicvoid displayProgress()

{

try

{

File outputFile =new File("Output.txt");

BufferedWriter bw =new BufferedWriter(new FileWriter(outputFile,true));

bw.append("" + (currentProcess + 1) +"\t" +"\t" +"\t" + status +"\t" +"\t" +"\t" + priority.get(currentProcess) +"\t" +"\t" +"\t" + time +"\t" +"\t" +"\t" + time +"\t" +"\t");

bw.append("\n");

bw.flush();

}

catch(IOException e)

{

e.printStackTrace();

}

}

Please suggest why this is happening.

Cheers anyone

[1660 byte] By [John4938a] at [2007-11-26 19:44:02]
# 1
If the file already already exists you could assume it has headings in it andnot write them again.
DrLaszloJamfa at 2007-7-9 22:27:51 > top of Java-index,Java Essentials,Java Programming...
# 2
You could modify the displayProgress method to accept a String parameter, the String which is to be appended to the file.
floundera at 2007-7-9 22:27:51 > top of Java-index,Java Essentials,Java Programming...
# 3
No problem, solution found:Used similar code in main to write the headings as this is only done once.Then the method that gets repeated (the one shown), appends after that.
John4938a at 2007-7-9 22:27:51 > top of Java-index,Java Essentials,Java Programming...