Java JOptionPane Error showError(Exception e)

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

Description

show Error

License

Open Source License

Declaration

public static void showError(Exception e) 

Method Source Code


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

import javax.swing.*;

import java.io.ByteArrayOutputStream;

import java.io.PrintStream;

public class Main {
    public static void showError(Exception e) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(baos);
        e.printStackTrace(ps);//from   ww  w.  j  av a2 s . c  o m
        String trace = baos.toString();

        e.printStackTrace();

        JOptionPane.showMessageDialog(null, trace, e.toString(), JOptionPane.ERROR_MESSAGE);
    }
}

Related

  1. showError(Component father, String title, String content)
  2. showError(Component parent, String message)
  3. showError(Component parent, String message)
  4. showError(Component parentComponent, Exception e)
  5. showError(Component where, String msg)
  6. showError(Exception e)
  7. showError(Exception e)
  8. showError(final Component component, final String title, final String message)
  9. showError(final Component rootComponent, final String message, final String title)