JScrollPane滚动到最后添加的行 [英] JScrollPane scroll at last added line
本文介绍了JScrollPane滚动到最后添加的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有JTextArea文本和JScrollPane窗格=新的JScrollPane(文本),我把pane.setAutoScrolls(true)。当我将一些文本附加到我的组件文本时,该窗格在末尾滚动(最后一行)时如何获得?
I have JTextArea text and JScrollPane pane=new JScrollPane(text), I put pane.setAutoScrolls(true). How to get that when I append some text to my component text that pane scrolls at the end ( last line ) ?
推荐答案
最佳(据我所知)最新,据Rob Camick解释插入符号的移动方式:
Best (and up-to-date, as far as I can tell) explanation of how caret is moved, by Rob Camick:
http://tips4java.wordpress.com/2008/10/22/text-area-scrolling/
这篇关于JScrollPane滚动到最后添加的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文