Class ErrorDialog

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

public class ErrorDialog extends JDialog
Utility class for displaying an error dialogue to the user. Calling the static showError method pops up a modal dialogue which informs the user what went wrong. As initially displayed this just contains the message or name of the exception plus optionally some additional lines of text, but a button is provided which can display the full stack trace.
Since:
23 Feb 2005
Author:
Mark Taylor (Starlink)
See Also:
  • Constructor Details

    • ErrorDialog

      public ErrorDialog(Frame frame, Throwable error, String title, String[] message)
      Constructor.
      Parameters:
      frame - frame which will own the dialogue
      error - throwable to be displayed
      title - dialogue window title
      message - additional text, one line per element
  • Method Details

    • showError

      public static void showError(Component parent, String title, Throwable error, String[] message)
      Pops up a modal dialogue displaying information about an error with an additional multi-line message.
      Parameters:
      parent - parent component
      title - title of the dialogue window
      error - the throwable to be displayed
      message - an array of one or more strings providing additional information about the error. Each string is displayed as a line.
    • showError

      public static void showError(Component parent, String title, Throwable error, String message)
      Pops up a modal dialogue displaying information about an error with an additional single-line message.
      Parameters:
      parent - parent component
      title - title of the dialogue window
      error - the throwable to be displayed
      message - one-line message text
    • showError

      public static void showError(Component parent, String title, Throwable error)
      Pops up a modal dialogue displaying information about an error.
      Parameters:
      parent - parent component
      title - title of the dialogue window
      error - the throwable to be displayed
    • showError

      public static void showError(Component parent, Throwable error)
      Pops up a modal dialogue displaying information about an error.
      Parameters:
      parent - parent component
      error - the throwable to be displayed
    • main

      public static void main(String[] args)