why ehen appending text file to text area, all the text in 1 line..

please hlp

publicvoid actionPerformed(ActionEvent e)

{

TArea.setText("");

try

{

String StrNeeded;

BufferedReader BR;

BR=new BufferedReader(new InputStreamReader(new FileInputStream("Data.txt")));

StrNeeded=BR.readLine();

while(StrNeeded!=null)

{

TArea.append(StrNeeded);

StrNeeded=BR.readLine();

}

}

catch(Exception excep)

{

}}

}

this is my code m problem is that,

i read a text file that has many lines, when i read it, i append it into the textarea, but what happend was all the text in my text area is in 1 line only(the other line is also appended but it is appended in the sama line.. help me

[1314 byte] By [w32sysfiea] at [2007-11-27 3:47:27]
# 1
readLine removed the line feed from the end of the line.You should append a \n to the end of the line like this:TArea.append(StrNeeded + "\n");Also it's a bad idea to catch an exception and do nothing.Add printStackTrace in the catch block.
Rodney_McKaya at 2007-7-12 8:51:13 > top of Java-index,Desktop,Core GUI APIs...
# 2
TArea.setLineWrap(true);
kloebera at 2007-7-12 8:51:13 > top of Java-index,Desktop,Core GUI APIs...