Re: JScrollPane + auto-scroll to the last appended line
- From: IchBin <weconsul@xxxxxxx>
- Date: Wed, 31 May 2006 14:59:53 -0400
oleth wrote:
HelloSomething like this...
I have an un-editable JScrollPane (a simple JtextArea). I append lines
to it when some events in my program happen.
I would like to ask how to make the scrollpane to scroll always down to
the last appened line. Currently the scroll pane's viewport stays in
the original place. When the pane is full, more lines are added, the
scroll bar appears, but it doesn't automatically scroll to the last
appended line. I have to scroll it manually to see the newest line
appended. How can I avoid it?
I 've searched the documentation but I had problems finding the correct
terminology to find this out.
Thanks
textArea.setCaretPosition(textArea.getText().length());
--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
.
- References:
- Prev by Date: Re: Easy question but I can't seem to get it to work
- Next by Date: Re: hi reg jsp page redirect
- Previous by thread: JScrollPane + auto-scroll to the last appended line
- Next by thread: hi reg jsp page redirect
- Index(es):
Relevant Pages
|
|