Java JTextArea printExceptionInfo(Exception e, JTextArea console)

Here you can find the source of printExceptionInfo(Exception e, JTextArea console)

Description

print Exception Info

License

Open Source License

Declaration

public static void printExceptionInfo(Exception e, JTextArea console) 

Method Source Code


//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());
    }
}

Related

  1. initTextAreaEdit(JTextArea j1)
  2. makeLabelStyle(JTextArea textArea)
  3. makeTabMoveFocus(JTextArea textArea)
  4. out(final JTextArea ta)
  5. preventInputingNewLineOnTextArea(JTextArea txe, AbstractAction actionOnEnter)
  6. printInfo(JTextArea txtInfo, String infoString)
  7. printInTextArea(JTextArea log, String[] toPrint)
  8. printStackTrace(Exception e, JTextArea console)
  9. printStream(final JTextArea ta)