Java JOptionPane Message showExceptionMessage(Exception e)

Here you can find the source of showExceptionMessage(Exception e)

Description

show Exception Message

License

Open Source License

Declaration

public static void showExceptionMessage(Exception e) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Component;
import javax.swing.JOptionPane;

public class Main {
    private static Component mainComponent = null;

    public static void showExceptionMessage(Exception e) {
        String msg = "An exception has occurred.\n\n" + e.toString()
                + "\n\nIf problems persist, please contact your local administrator.";
        // log exception
        e.printStackTrace(System.out);

        JOptionPane.showMessageDialog(mainComponent, msg, "Exception", JOptionPane.ERROR_MESSAGE);
    }/*from w  ww .  j a v a  2  s .c  o m*/
}

Related

  1. showAlert(String message)
  2. showException(Component c, String message, Throwable t)
  3. showException(String message, Exception ex)
  4. showExceptionMessage(Component parent, Throwable t)
  5. showExceptionMessage(Component parentComponent, Exception exception)
  6. showExceptionMessage(Exception e)
  7. showInput(Component parent, String message, String initValue)
  8. showInput(String message)
  9. showInputInteger(String message)