public class ConsoleTextArea extends JTextArea { public ConsoleTextArea(InputStream[] inStreams) { for(int i = 0; i < inStreams.length; ++i) startConsoleReaderThread(inStreams); } // ConsoleTextArea()
public ConsoleTextArea() throws IOException { final LoopedStreams ls = new LoopedStreams();
// 重定向System.out和System.err PrintStream ps = new PrintStream(ls.getOutputStream()); System.setOut(ps); System.setErr(ps);