com.darwinsys.swingui
Class ErrorUtil

java.lang.Object
  extended bycom.darwinsys.swingui.ErrorUtil

public class ErrorUtil
extends java.lang.Object

Convenience class for fielding Exceptions in a Swing App. Displays exceptions in a JOptionPane, and follows chained exceptions, both the 1.x SQLException.getNextExeption() and the new 1.4 Exception.getCause().

The user (will be able to) press a Details... button to see the traceback in a dialog; tracebacks are not displayed unless the user requests them.

Version:
$Id: ErrorUtil.java,v 1.8 2004/03/07 17:14:57 ian Exp $
Author:
Ian Darwin

Nested Class Summary
protected static class ErrorUtil.DetailsDialog
          Inner class Dialog to display the details of an Exception
 
Field Summary
protected static ErrorUtil.DetailsDialog detailsDialog
          Secondary dialog for the "Details..." button
 
Constructor Summary
ErrorUtil()
          Public no-arg constructor for those who like simple instantiation.
 
Method Summary
 void handle(java.lang.Throwable th)
          Convenience routine for use with AWT's dispatch thread.
static void showExceptions(java.awt.Component parent, java.lang.Throwable theExc)
          Show the given Exception (and any nested Exceptions) in JOptionPane(s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

detailsDialog

protected static ErrorUtil.DetailsDialog detailsDialog
Secondary dialog for the "Details..." button

Constructor Detail

ErrorUtil

public ErrorUtil()
Public no-arg constructor for those who like simple instantiation.

Method Detail

handle

public void handle(java.lang.Throwable th)
Convenience routine for use with AWT's dispatch thread. Usage:
 System.setProperty("sun.awt.exception.handler",
		"com.darwinsys.swingui.ErrorUtil");
 


showExceptions

public static void showExceptions(java.awt.Component parent,
                                  java.lang.Throwable theExc)
Show the given Exception (and any nested Exceptions) in JOptionPane(s).



Copyright © 2000-2003 Ian F. Darwin. See license.html for usage license.