Here you can find the source of showError(Exception e)
public static void showError(Exception e)
//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); } }