I haven't been able to find anything on this anywhere, even in the bug database.
It may have something to do with the fact that I'm updating a swing component outside of the event dispatch thread. I just discovered the importance of SwingUtilities...
It's interesting that it works 99.9% of the time. Hopefully when I rewrite the code this wont pop up again.
Hi,
have you solved the problem concerning the "interrupted attempt..."? I get the same error - in a similar situation. My program is also multi-threaded and I'm trying to set new values for some UI elements in a different thread. My program works most of the time, too...
Thanks in advance,
Nicolas
You should make sure that all observers are notified of one update before making any futher modifications. Using the interface incorrectly would possibly yield "interrupted attempt..." error. This probably happens when two successive modifications happen "fast enough".
Best, Eran
-
"[an AbstractDocument]....allows multiple readers or one writer, and writers must wait until
all observers of the document have been notified of a previous change before beginning another mutation to the document. The read lock is aquired and released using the render
method. A write lock is aquired by the methods that mutate the document, and are held for the duration of the method call. Notification is done on the thread that produced the mutation,
and the thread has full read access to the document for the duration of the notification, but other readers are kept out until the notification has finished. The notification is a beans event notification which does not allow any further mutations until all listeners have been notified." (AbstractDocument documentation)