Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #20040 > unrolled thread
| Started by | Jan Burse <janburse@fastmail.fm> |
|---|---|
| First post | 2012-12-02 18:29 +0100 |
| Last post | 2012-12-02 19:09 +0100 |
| Articles | 3 — 1 participant |
Back to article view | Back to comp.lang.java.programmer
Is there a delay in select() of JTextComponent? Jan Burse <janburse@fastmail.fm> - 2012-12-02 18:29 +0100
Re: Is there a delay in select() of JTextComponent? Jan Burse <janburse@fastmail.fm> - 2012-12-02 18:52 +0100
Re: Is there a delay in select() of JTextComponent? Jan Burse <janburse@fastmail.fm> - 2012-12-02 19:09 +0100
| From | Jan Burse <janburse@fastmail.fm> |
|---|---|
| Date | 2012-12-02 18:29 +0100 |
| Subject | Is there a delay in select() of JTextComponent? |
| Message-ID | <k9g365$t0b$1@news.albasani.net> |
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/docs/api/javax/swing/text/JTextComponent.html#select%28int,%20int%29
[toc] | [next] | [standalone]
| From | Jan Burse <janburse@fastmail.fm> |
|---|---|
| Date | 2012-12-02 18:52 +0100 |
| Message-ID | <k9g4gj$1ah$1@news.albasani.net> |
| In reply to | #20040 |
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
[toc] | [prev] | [next] | [standalone]
| From | Jan Burse <janburse@fastmail.fm> |
|---|---|
| Date | 2012-12-02 19:09 +0100 |
| Message-ID | <k9g5hl$4h4$1@news.albasani.net> |
| In reply to | #20040 |
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/docs/api/javax/swing/text/JTextComponent.html#select%28int,%20int%29 >
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web