How do scroll the contents to bottom by default in JTextPane?

Posted by Nitesh Panchal on Stack Overflow See other posts from Stack Overflow or by Nitesh Panchal
Published on 2010-05-11T11:47:52Z Indexed on 2010/05/11 11:54 UTC
Read the original article Hit count: 193

Filed under:
|

Hello, I have JTextPane on my window and i have JTextField. When i press enter enter in JTextField, the text gets added in JTextPane. Everything works fine and scrollbar too appears on its own. But, it doesn't appear properly. It automatically scrolls to the beginning of the content in JTextPane. How do i keep the scrollbar to the end of JTextPane?

Please let me know if my question is unclear. Thanks in advance :)

© Stack Overflow or respective owner

Related posts about java

Related posts about swing