void alert(Component parent){
alert(parent,"ThrowableManager Alerter");
}
/**
* Show the information in a dialog with the specified title.
*
* @param titleThe title of the dialog.
*/
public synchronized void alert(String title){
alert((Component)null,title);
}
/**
* Show the information in a dialog which has the specified title and belongs to the
* specified component.
*
* @param parentThe component cause the exception.
* @param titleThe title of the dialog.
*/
public synchronized void alert(Component parent,String title){
StringBuilder errorMessage=new StringBuilder();
errorMessage.append(this.toString());
for (StackTraceElement st:((this.getCause()==null)?this:this.getCause()).getStackTrace()){
errorMessage.append("
at ");
errorMessage.append(st.toString());
}
alerter.showMessageDialog(parent, errorMessage, title ,JOptionPane.ERROR_MESSAGE);
System.err.println(errorMessage);
}
}