Class ExceptionDialog

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

public class ExceptionDialog extends JDialog
A custom modal dialog for displaying exceptions with a properly formatted and indented stack trace.
Author:
anahata
See Also:
  • Constructor Details

    • ExceptionDialog

      public ExceptionDialog(Window owner, String taskName, String description, String stackTrace)
      Constructs a new ExceptionDialog.
      Parameters:
      owner - The owner window.
      taskName - The name of the task that failed.
      description - a brief description of the error.
      stackTrace - The exception to display.
  • Method Details

    • initComponents

      private void initComponents(String taskName, String description, String stackTrace)
      Initializes the dialog's components and layout.

      This method sets up the header with the task name and error description, a scrollable text area for the stack trace, and a button panel for copying the trace and closing the dialog.

      Parameters:
      taskName - The name of the failed task.
      description - The brief error description.
      stackTrace - The full stack trace string.
    • show

      public static void show(Component component, String taskName, String description, String stackTrace)
      Static utility method to show the exception dialog.
      Parameters:
      component - The relative component.
      taskName - The task name.
      description - The description.
      stackTrace - The exception.
    • show

      public static void show(Component component, String taskName, String description, Throwable t)
      Static utility method to show the exception dialog.
      Parameters:
      component - The relative component.
      taskName - The task name.
      description - The description.
      t - The exception.