This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Problem Document Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem Document Listener "Attempt to mutate in notification"" Watch "Problem Document Listener "Attempt to mutate in notification"" New topic

Problem Document Listener "Attempt to mutate in notification"

David Hittel

Joined: May 25, 2007
Posts: 11

i have following Problem. I have a couple of jTextField's that are registered to a DocumentListener.

I had the problem that i got always the Exception

Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Attempt to mutate in notification
at javax.swing.text.AbstractDocument.writeLock(
at javax.swing.text.AbstractDocument.replace(
at javax.swing.text.JTextComponent.setText(

Then i was reading a little bit and found a solution, but this solution causes another problem, a endless loop and i get this

I want to call a method "calculate" with just some normal calculation from jTextField values.

The DocumentListener

calls the berechne()

Do you have any solutions, to solve the problem.
subject: Problem Document Listener "Attempt to mutate in notification"
jQuery in Action, 3rd edition