Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Is there a delay in select() of JTextComponent? (http://www.velocityreviews.com/forums/t955034-is-there-a-delay-in-select-of-jtextcomponent.html)

Jan Burse 12-02-2012 05:29 PM

Is there a delay in select() of JTextComponent?
 
Dear All,

I have a very simple application. There is a menu item
with a F2 accelerator. The action of the menu item will
advance the selected text region of the underlying text
component.

When I press and hold down F2, I will get multiple actions
at the same rate as for example when pressing and holding
down the arrow down key. But somehow the for my F2, the
GUI is not able to keep up. But the arrow down key
can do so.

How can I prevent that my F2 actions get stacked up because
the GUI is not responding fast enough? It seems that the
GUI is fast enough, since everything else works fine, such
as arrow down or scroll bar. But somehow the select() seems
to be slow.

Bye

(*)
http://docs.oracle.com/javase/1.4.2/...8int,%20int%29

Jan Burse 12-02-2012 05:52 PM

Re: Is there a delay in select() of JTextComponent?
 
Jan Burse schrieb:
> How can I prevent that my F2 actions get stacked up because
> the GUI is not responding fast enough? It seems that the
> GUI is fast enough, since everything else works fine, such
> as arrow down or scroll bar. But somehow the select() seems
> to be slow.


It happens already with this simple action:

int offset = getSelectionEnd();
select(offset + 150, offset + 155);

I am using a TextArea with around 51'000 text lines.

Bye

Jan Burse 12-02-2012 06:09 PM

Re: Is there a delay in select() of JTextComponent?
 
Interesting, its platform specific. Happens on Windows 7,
but not on Mac OS 10.8, both with JDK 1.7.

Jan Burse schrieb:
> Dear All,
>
> I have a very simple application. There is a menu item
> with a F2 accelerator. The action of the menu item will
> advance the selected text region of the underlying text
> component.
>
> When I press and hold down F2, I will get multiple actions
> at the same rate as for example when pressing and holding
> down the arrow down key. But somehow the for my F2, the
> GUI is not able to keep up. But the arrow down key
> can do so.
>
> How can I prevent that my F2 actions get stacked up because
> the GUI is not responding fast enough? It seems that the
> GUI is fast enough, since everything else works fine, such
> as arrow down or scroll bar. But somehow the select() seems
> to be slow.
>
> Bye
>
> (*)
> http://docs.oracle.com/javase/1.4.2/...8int,%20int%29
>




All times are GMT. The time now is 07:39 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.