If application code throws an exception which it does not itself catch, there is a crash in the current EventQueue DispatchThread. So although to the user the application may appear to continue to run to some extent, really this is an internal error in the application which should be reported to the user and the application terminated.

It is impractical to put a try-catch around every possible event handler in the application. So the question... is it somehow possible to catch exceptions within the EventQueue's DispatchThread and execute some code? I vaguely see some possibility of putting the dispatch threads in a thread group and using ThreadGroup.uncaughtException()???

Quoted below is the is the documentation of the private method handleException of java.awt.EventDispatchThread. It's not a long-term solution but it does work.

Handles an exception thrown in the event-dispatch thread.

If the system property "sun.awt.exception.handler" is defined, then when this method is invoked it will attempt to do the following:

Load the class named by the value of that property, using the current thread's context class loader,

Instantiate that class using its zero-argument constructor,

Find the resulting handler object's public void handle method, which should take a single argument of typeThrowable, and

Invoke the handler's handle method, passing it thethrown argument that was passed to this method.

If any of the first three steps fail then this method will returnfalse and all following invocations of this method will returnfalse immediately. An exception thrown by the handler object'shandle will be caught, and will cause this method to returnfalse. If the handler's handle method is successfully invoked, then this method will return true. This method will never throw any sort of exception.

Note: This method is a temporary hack to work around the absence of a real API that provides the ability to replace the event-dispatch thread. The magic "sun.awt.exception.handler" propertywill be removed in a future release.