|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectExceptionHandler
public final class ExceptionHandler
Custom handler for uncaught exceptions.
By default, a Swing app will handle uncaught exceptions simply by printing a stack trace to
System.err. However, the end user sees nothing happen.
This class addresses that problem, by showing the end user a simple error message in a modal dialog.
(The dialog's owner is the currently active frame.)
In JDK1.4, the simplest way of overriding the default handler for uncaught exceptions is to use the following undocumented feature :
System property named 'sun.awt.exception.handler',
whose value is the fully qualified class name of this new handler class
Other alternative methods include :
Handler, and attach it to your application's loggers
ThreadGroup.uncaughtException(java.lang.Thread, java.lang.Throwable)
| Constructor Summary | |
|---|---|
ExceptionHandler()
No-argument constructor. |
|
| Method Summary | |
|---|---|
void |
handle(Throwable aThrowable)
Custom handler for uncaught exceptions. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExceptionHandler()
| Method Detail |
|---|
public void handle(Throwable aThrowable)
Displays a simple model dialog to the user, showing that an error has occured.
The text of the error includes Throwable.toString().
|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||