Here you can find the source of printExceptionInfo(Exception e, JTextArea console)
public static void printExceptionInfo(Exception e, JTextArea console)
//package com.java2s; //License from project: Open Source License import javax.swing.*; import java.io.PrintWriter; import java.io.StringWriter; public class Main { public static void printExceptionInfo(Exception e, JTextArea console) { console.append(e.getMessage());//from ww w . j a va 2 s . c om printStackTrace(e, console); } public static void printStackTrace(Exception e, JTextArea console) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); console.append(pw.toString()); } }