Class ErrorDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ErrorDialog extends JDialog
A dialog to display a runtime exception stack trace.
See Also:
  • Field Details

  • Constructor Details

    • ErrorDialog

      public ErrorDialog(Throwable t)
      Creates a modal dialog to display the given exception message.
      Parameters:
      t - the exception to display
    • ErrorDialog

      public ErrorDialog(JComponent owner, Throwable t)
      Creates a modal dialog to display the given exception message.
      Parameters:
      owner - if non-null, then the dialog is positioned (centered) w.r.t. this component
      t - the exception to display
    • ErrorDialog

      public ErrorDialog(JComponent owner, Icon icon, Throwable t)
      Creates a modal dialog to display the given exception message.
      Parameters:
      owner - if non-null, then the dialog is positioned (centered) w.r.t. this component
      icon - the icon to display
      t - the exception to display
  • Method Details

    • position

      static void position(Component c, Component parent)
      Position the given component at the center of the given parent component or physical screen.
      Parameters:
      c - the component to be positioned
      parent - the component whose center will match the center of the given component. If null, the given component will match the screen center.
    • createContent

      final JComponent createContent()
      Creates the display with the top-level exception message followed by a pane (that toggles) for detailed stack traces.
    • createErrorMessage

      final JComponent createErrorMessage(Throwable t)
      Creates a non-editable widget to display the error message.
    • createDetailedMessage

      JScrollPane createDetailedMessage()
      Creates a non-editable widget to display the detailed stack trace.
    • generateStackTrace

      StringBuilder generateStackTrace(Throwable t, StringBuilder buffer)
      Recursively print the stack trace on the given buffer.
    • toString

      StringBuilder toString(StackTraceElement[] traces)
    • isSuppressed

      private boolean isSuppressed(String className)
      Affirms if the error messages from the given class name is to be suppressed.