Re: Keyboard scrolling of JTextPane
- From: usenet@xxxxxxx (Christian Kaufhold)
- Date: Tue, 12 Jul 2005 19:06:46 +0000 (UTC)
Morten Alver <mortenalver@xxxxxxx> wrote:
> I have a non-editable JTextPane put inside a JScrollPane, and showing HTML
> formatted text. When using the arrow keys up and down to scroll the text,
> there is a "latency" of a certain number of keypresses, as if there is a
> cursor that needs to reach the edge of the viewport before scrolling starts
> (since we are in non-editable state, there is no visible cursor). The
> example code below demonstrates the problem (run it, click in the text
> pane, and use arrow keys to scroll up and down). I am running with the Sun
> JDK 1.4.2.07 under Linux/AMD64.
>
> How can I change this behaviour so it scrolls up and down immediately on the
> first click of an arrow key?
The simplest seems to me to remove these actions from editorKit.getActions()
so that the arrow keys are handled by the scroll pane and not the JTextPane.
Christian
.
- Follow-Ups:
- Re: Keyboard scrolling of JTextPane
- From: Morten Alver
- Re: Keyboard scrolling of JTextPane
- References:
- Keyboard scrolling of JTextPane
- From: Morten Alver
- Keyboard scrolling of JTextPane
- Prev by Date: Re: JButton - Set font to fill
- Next by Date: Re: Need to change single node in JTree when JCheckbox selected
- Previous by thread: Keyboard scrolling of JTextPane
- Next by thread: Re: Keyboard scrolling of JTextPane
- Index(es):
Relevant Pages
|