Re: Keyboard scrolling of JTextPane



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
.



Relevant Pages

  • Re: cant use scrollbars on large spreadsheet, they bounce back
    ... If you hold down the key while pressing the arrow keys this ... I have encountered the problem you describe with scroll bars before, ... I now understand why we got the "too many cell formats" before and we ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Several NetBSD questions
    ... > screen, but PgUp, PgDown and arrow keys do nothing. ... You don't get it to scroll. ... Patches to make it scrolling have been floating around; ... TERM on NetBSD. ...
    (comp.unix.bsd.netbsd.misc)
  • Re: Scrolling problem using Word 2004 on 2nd monitor
    ... I forgot to mention in my earlier post that using the arrow keys ... using the arrow keys to scroll up does not cause the problem. ... using the mouse scroll or the keyboard down key to ... helping remedy this problem. ...
    (microsoft.public.mac.office.word)
  • Navigation in Dialog
    ... arrow keys, and at the same time be able to scroll a message body. ... might call this a "dual focus". ... message pane is scroll the article, and I feel it should be possible to ...
    (news.software.readers)
  • Re: no sound on audigy snd in suse 91
    ... heavenbound wrote: ... >> the arrow keys, scroll way over to the right and find the slider marked ... > well if there's no way to in suse make the sound work permantly then there ...
    (alt.os.linux.suse)