Results 1 to 7 of 7
Thread: Deadlock with DocumentListener
- 04-26-2012, 02:30 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 3
- Rep Power
- 0
Deadlock with DocumentListener
Hi,
I was also facing the same problem when i was using documentListener and trying to change the value of text feild. But after using SwingUtilities.invokeLater it got resolved. But after changing the text the focus is getting lost. It is going into deadlock state as there is a synchonous lock that is with document and calling setText() JtextFeild is trying to get the lock so that's y it is going in deadlock state.
Can you please tell me how can i change the value of text feild using documentListener
- 04-26-2012, 02:44 PM #2
Re: Deadlock with DocumentListener
When you have a question, start your own thread -- they're free. Don't resurrect an old thread and don't add an unrelated question in another poster's thread.
Removed from http://www.java-forums.org/new-java/...textfield.html
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 04-26-2012, 02:46 PM #3
Re: Deadlock with DocumentListener
You need to respect Swing's single threaded rule. Note that many Swing methods which are, up to Java SE 6, documented as being thread-safe are in fact not thread-safe. This has been recognized and the documentation has been corrected in Java SE 7.
All Swing constructors and methods, with the possible exception of repaint(), should be called only on the EDT.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 04-27-2012, 07:10 AM #4
Member
- Join Date
- Apr 2012
- Posts
- 3
- Rep Power
- 0
Re: Deadlock with DocumentListener
So is there any way to change the value of text feild using document listener during document event?
- 04-27-2012, 07:17 AM #5
Re: Deadlock with DocumentListener
You use a DocumentFilter, not a DocumentListener for that.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 04-30-2012, 11:31 AM #6
Member
- Join Date
- Apr 2012
- Posts
- 3
- Rep Power
- 0
- 04-30-2012, 03:30 PM #7
Re: Deadlock with DocumentListener
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
DocumentListener, KeyListener or a third option?
By Muskar in forum New To JavaReplies: 6Last Post: 11-20-2010, 11:58 PM -
Compiler deadlock
By Arnold in forum New To JavaReplies: 2Last Post: 06-27-2010, 12:57 PM -
Use documentlistener to get source of which text field is changed
By Andolph23 in forum AWT / SwingReplies: 3Last Post: 05-28-2010, 04:18 AM -
[SOLVED] Deadlock ?
By jon80 in forum New To JavaReplies: 1Last Post: 06-14-2009, 07:54 PM -
Thread Deadlock
By ajeeb in forum New To JavaReplies: 2Last Post: 01-16-2009, 02:49 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks