🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9980

simulate telnet window with textPane?

#9980
From: Trey Ethridge
Date: Sun, 05 Dec 1999 00:00
18 lines
1472 bytes
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: <82f9a5$lqj6@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,dfce3bcc41cbd2f2,start
X-Google-Attributes: gid111d45,public
From: "Trey Ethridge" <ethridgt@earthlink.net>
Subject: simulate telnet window with textPane?
Date: 1999/12/05
Message-ID: <82f9a5$lqj6@forums.borland.com>
X-Deja-AN: 557101224
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing