Here you can find the source of printStackTrace(Exception e, JTextArea console)
public static void printStackTrace(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 printStackTrace(Exception e, JTextArea console) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw);//from w w w .j a v a2s. c om console.append(pw.toString()); } }