This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem Document Listener "Attempt to mutate in notification"

David Hittel
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic