🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Progrmatically Scrolling a JTextArea in a JScrollPane to the last line

#8474
From: Paul Furbacher [TeamB]
Date: Sun, 27 Aug 2000 00:00
38 lines
2160 bytes
Larry Maturo wrote:
> 
> Someone sent me the answer to this, so I thought I would share it with
> the group.
> 
> Given that you JTextArea is named MyTextArea and your JScrollPane
> is named MyScrollPane you would use:
> 
> getMyScrollPane().getViewport().setViewPosition(new
> Point(0,getMyTextArea().getMaximumSize().height));
> 

Thanks for sharing.

Just a note which is more for the wider readership: a search 
of the MERS site (see a list of search sites for JBuilder -- 
http://www.borland.com/newsgroups/ngsearch.html) -- for the 
keywords "scroll jtextpane" yields the answer.  True, 
jtextpane != jtextarea, but they are related, so it's not too
much of a leap of imagination, which is what all searching, 
whether in the library or on the net, requires.  

The point is that there is a great wealth of info which has
been archived by the search sites, and I'm guessing that they
are under utilized.  My intention is not to be critical for 
asking a question in the newsgroup, but to point out that 
there are other sources.  Especially if you are in a hurry, 
or it's over a weekend, which 3:58 pm Friday almost qualifies as.

As a member of TeamB, it's sort of my responsibility to track 
down answers.  Sometimes, I'll see a question which has been asked 
many times, but I seem to have forgotten the solution.  So, 
it's off to the search sites, and within a few tries, there they 
are, multiple postings of solutions to multiple variants of the 
same question.


Paul Furbacher (TeamB)
Technical Details
Message-ID: <39A94BDB.D7A706DD@home.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39a6c7bb_2@dnews> <39a6cad2_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,a51abcebed13651a
X-Google-Attributes: gid111d45,public
From: "Paul Furbacher [TeamB]" <pnf@home.com>
Subject: Re: Progrmatically Scrolling a JTextArea in a JScrollPane to the last  line
Date: 2000/08/27
Message-ID: <39A94BDB.D7A706DD@home.com>
X-Deja-AN: 663167730
Content-Transfer-Encoding: 7bit
References: <39a6c7bb_2@dnews> <39a6cad2_1@dnews>
X-Accept-Language: en,pdf
Content-Type: text/plain; charset=us-ascii
Organization: Reverse Alchemy, Inc.
Mime-Version: 1.0
Reply-To: pnf@home.com
Newsgroups: borland.public.jbuilder.java.swing