JTextArea help
Hey guys and gals,
this is probably goign to be a REALLY easy one for everyone (and probably shoudl be for me) but im working on an application that edits a JTextArea at runtime and i have the following method
publicvoid addText(String s)
{
convo.append(s +"\r\n");
}
Anyone know why the newline isnt added to the component?
D
# 2
I am not trying to save the text to a file, the text when the application finishes can simply be forgotten about.
I just need a new line added at run time
basically a number of system message will appear in the area and at the moment it looks like
message 1message 2message 3
but should look like
message 1
message 2
message 3
D
# 5
I gave you a working example.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.