I have a _result
JtextArea. Every second there is a new piece of text String
being appended to it.
By default, the cursor is at the top.
I need the cursor always to be at the very end of the text in the JTextArea. So that I could see what is the last String being appended.
_result.append("my text");
// How do I make the cursor of `_result` JTextArea to be at the end of the text?
There is no
append()
method for aJTextField
. I assume you are talking about aJTextArea
.By default the caret should display at the end of the text. If not then you may be doing something wrong. Ccheck out Text Area Scrolling for more information and a couple of solutions.
Maybe this will help.
You could also try:
then try to append the new text if you only wish to see only the appended text.