Article View: borland.public.jbuilder.java.swing
Article #9100Re: How to programmatically scroll JTextPane?
From: Paul Furbacher [TeamB]
Date: Wed, 24 May 2000 00:00
Date: Wed, 24 May 2000 00:00
16 lines
1275 bytes
1275 bytes
Ravinder Battu wrote: > I have an application with a JTextPane (within a JScrollPane) in it. I want > my JTextPane to scroll one page at a time periodically. How can I do that? > Any pointers are greatly appreciated.... Have you tried using the viewport's "setViewPosition(Point)" method? I'd start there. And when you scroll the page, remember that it is customary to scroll a page minus one line so that the reader is given the sense that no lines were missed. This means that the last line on page 1 is shown as the first line on page 2, and so on. You'll have to calculate a bunch of heights, but it should be pretty straightforward. Paul Furbacher (TeamB)
Technical Details
Message-ID:
<392BE781.4836EAA7@home.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8ge3v4$pre1@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,53489a938c31090b X-Google-Attributes: gid111d45,public From: "Paul Furbacher [TeamB]" <pnf@home.com> Subject: Re: How to programmatically scroll JTextPane? Date: 2000/05/24 Message-ID: <392BE781.4836EAA7@home.com> X-Deja-AN: 626735575 Content-Transfer-Encoding: 7bit References: <8ge3v4$pre1@bornews.borland.com> 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