Skip to main content

AWT event thread exceptions when gui updates quikly

1 reply [Last post]
Joined: 2006-06-20

Hi, I get these ArrayIndexOutOfBounds exceptions in the AWT-Event Dispatch thread when my program updates the JTable rather quickly. It doesn't seem to harm the program's functionality or stability (as far as I know,) but I'd like to see if there is away to prevent them from happening. I use JDK could this be a syncrhonization problem? or do I have to put EVERY swing command in EventQueue.runLater() ?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-06-19

This could be a syncrhonisation problem. If you're update is running as an event handling method, then it's automatically executed on the Event Dispatch Thread. I'm led more to believe that it's an actual mistake in the code though and the index out of bounds will happen anyway. Do a LOT more testing to isolate the problem. The Exceptions you're seeing from the EDT are a problem since it means something in your program is going seriously wrong. Read up on concurrency issues a bit to understand threading in Java esp. Swing. There are articles dedicated to it.