I've created a JTextArea and I'm able to move it to a new location. Code is something like this:
textArea/scrollPane are defined above this section. Everything works just fine except when the text I'm adding to the textArea gets to the bottom of the textArea and forces a Scroll Bar, it doesn't automatically scroll down to see the newest text. What am I missing? How can I force this to auto scroll down.
textArea = new JTextArea(45, 35);
scrollPane = new JScrollPane(textArea);
Found this out on the INTERWEBS:
Sets the cursor position to the bottom of the new appended text. In conclusion auto scrolls down each time new text is appended.
Sorry for posting without doing enough research but for those who may stumble upon this problem yourself give this a shot.
Yep, that's exactly what I encountered on first actual use, how do ( code ) detect caret.notVisible() without wasting resources?
And if you wish to avoid the default scrolling, or need greater flexibilty check out Rob Camick's blog posts.
Text Area Scrolling « Java Tips Weblog
Text Utilities « Java Tips Weblog