> Hello!
>
[quoted text clipped - 4 lines]
> inside the text field. Application freezes immediatelly. Please, what have I
> done wrong?
You might have run into the same problem I saw with a JTextArea. They
both have an underlying Document so this quite possible.
Gory details are in my earlier post today that was about Swing
performance issues.
Like you, I was using a worker Thread to update the JTextArea. I also
have a KeyListener to grab key strokes and pass them into my model
object, but every so often, while I was typing, the application would
report a failure to get a writelock on the Document, stack dump and
freeze, though its menu bar still worked to exit from it.
The solution in my case was to rewrite the worker thread as a
javax.swing.Timer. The worker thread's repeated action was turned into
an ActionListener.actionPerformed() method which is fired by the
javax.swing.Timer. The effect is to execute the actionPerformed() code
in Swing's event dispatching thread, which side-steps the writelocking
problem.

Signature
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
Vojta - 13 Mar 2006 15:59 GMT
Hello Martin,
thank you a lot for your advice! Vojta
>> Hello!
>>
[quoted text clipped - 23 lines]
> Swing's event dispatching thread, which side-steps the writelocking
> problem.