Article View: borland.public.jbuilder.java.swing
Article #10009Re: simulate telnet window with textPane?
From: Zippy
Date: Fri, 10 Dec 1999 00:00
Date: Fri, 10 Dec 1999 00:00
21 lines
1772 bytes
1772 bytes
use insertstring and insert the string at the end of the document by using the documents getLength() >Hello all, > >I'm having a problem getting a jTextPane to show the last string that I've >added to it. What I'm doing is using a JTextPane contained within a >JScrollPane to show some strings that I'm sending to the application. The >application is a simple test server for another app. Each time the server >app receives a string it gets the current contents of the textpane, appends >the new string and then writes the updated text to the textPane. Everything >works fine until the text gets to the bottom of the viewable area and the >scrollbars appear. I want the window to scroll up showing the last string >appended, but instead the scrollpane defaults to the first string at the >top. To see the newly appended string I have to scroll back to the bottom. >I know there has to be a way to set the focus to the last line in the >textpane, but I just can't figure it out. Can anyone send me a simple >solution? > >Thanks in advance, >Trey Ethridge >
Technical Details
Message-ID:
<38515beb.638206@news.pangea.ca>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<82f9a5$lqj6@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,dfce3bcc41cbd2f2 X-Google-Attributes: gid111d45,public From: Zippy@Pangea.ca (Zippy) Subject: Re: simulate telnet window with textPane? Date: 1999/12/10 Message-ID: <38515beb.638206@news.pangea.ca> X-Deja-AN: 558827661 Content-Transfer-Encoding: 7bit References: <82f9a5$lqj6@forums.borland.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@pangea.ca X-Trace: pumpkin.pangea.ca 944792174 437 64.4.88.63 (10 Dec 1999 02:16:14 GMT) Organization: Oats Mime-Version: 1.0 Reply-To: Zippy@Pangea.ca NNTP-Posting-Date: 10 Dec 1999 02:16:14 GMT Newsgroups: borland.public.jbuilder.java.swing