• Post Reply Bookmark Topic Watch Topic
  • New Topic

Fixing a JScrollPane to the bottom  RSS feed

 
Casey Li
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developing a ChatProgram and currently have a JScrollPane with a JTextArea as its component. As the textarea grows, the vertical scrollbar appears, but the problem is that the viewing area stays at the top. I was wondering if anyone knew how to fix the JScrollPane to the bottom of its viewing area. In other words, as the textarea grows, the text area moves up like in most chat programs. Any help would be greatly appreciated.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could set the value of the scrollbar
myScrollPane.getVerticalScrollBar().setValue(int);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!