Add text to TextArea component dinamically.

Hi, I need a textarea where I can dinamically add text. I have the output of some ssh commands and I need to add these log outputs to the textarea as commands are being executed.I tried using the textArea component and the setCursorPosition method, but it doesnt work for me, and Strings are overlapped, so I just can see the last String added to textArea.
Using JDK I could do it using JTextPane object,like this:

textPane.getStyledDocument().insertString(lenght, eventMsg , currentSet);

Got any ideas how can I do it using vaadin components?
Thanks in advance,

Hello Celeste,

do you want add just a new line to your text area?

void addNewText(String messageFromSomeWhere) {
  myTextArea.setValue(myTextArea.getValue() + "\n" + messageFromSomeWhere);

That should do the trick

Hi Wolfgang, thanks for your reply. That solved my problem, but I dont know if that would be inefficient because the whole content is always going to the user on very update, and the log I got is really big.
Do you know some approach for that?

Thank you very much!

Hi Celeste,

just an idea: You could bind the TextArea to a Property of a itemDataSource. The Property has a StringBuffer as data. Now you add a converter ( to your TextArea where
convertToPresentation() returns stringBuffer.toString() and convertToModel() does nothing because your TextArea will be readOnly(?).
If you want to add a new line you call stringBuffer.append().