Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Is there a delay in select() of JTextComponent?

Reply
Thread Tools

Is there a delay in select() of JTextComponent?

 
 
Jan Burse
Guest
Posts: n/a
 
      12-02-2012
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
 
Reply With Quote
 
 
 
 
Jan Burse
Guest
Posts: n/a
 
      12-02-2012
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
 
Reply With Quote
 
 
 
 
Jan Burse
Guest
Posts: n/a
 
      12-02-2012
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
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hmmm, why is there a delay when saving files in Fx? Wedge Firefox 6 10-24-2008 10:10 PM
Why there's a little delay after I save JPGs using ImageWriter ZelluX Java 11 05-20-2008 02:05 AM
Calculating propagation delay & transmission delay Stone Cisco 1 09-27-2006 06:26 PM
Is there a delay when you take a shot? Nusat Digital Photography 16 07-05-2004 06:32 PM
shutter delay - what is going on in there? Another Bob Digital Photography 7 01-11-2004 12:21 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57