|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.gui.GUIExceptionHandler
Handles uncaught exceptions from an AWT event thread. Note that this class does NOT handle uncaught exceptions from non-AWT event threads!
This is an effective but nonportable (it will not work on non-Sun JVMs, and may not work in future Java versions) of handling uncaught exceptions.
This code was derived from a Java Developer Forum post.
System.setProperty("sun.awt.exception.handler" ,"dip.gui.GUIExceptionHandler");Alternatively, this can be done transparently with the registerHandler() method.
When an uncaught exception occurs in the EventDispatchThread, it
will check the value of "sun.awt.exception.handler", create an
instance of the class and call its handle
method.
Constructor Summary | |
GUIExceptionHandler()
Default Constructor |
Method Summary | |
void |
handle(java.lang.Throwable thrown)
Handles the thrown Exception, from an AWT event thread |
static boolean |
registerHandler()
Registers this GUIExceptionHandler for uncaught Exceptions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GUIExceptionHandler()
Method Detail |
public static boolean registerHandler()
false
if the handler could
not be registered.
public void handle(java.lang.Throwable thrown)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |