Fiz um programa exatamente agora, que escreve a saida do System.out no JTextArea. Como não tenho tempo, não vou colocar os comentários agora, se tiver dúvidas é só falar.
public class TesteOutPutTrace
{
/**
Trace default da aplicação.
*/
public static PrintStream
DefaultTrace = System.out;
/**
Construtor da classe.
*/
public TesteOutPutTrace()
{
WindowOutPut lo_area = new WindowOutPut();
lo_area.setVisible(true);
DefaultTrace = new PrintStream(lo_area.TRACE, true);
System.setOut(DefaultTrace);
System.out.println("a");
System.out.println("b");
System.out.println("c");
}
private class WindowOutPut extends JFrame
{
public OutputStream TRACE = new TraceConsoleOutputStream();
public JTextArea text;
public WindowOutPut()
{
setSize(500, 500);
text = new JTextArea();
getContentPane().add(text);
}
private class TraceConsoleOutputStream extends OutputStream
{
public void write(int b) {
text.append(""+b);
}
public void write(byte[] b) {
text.append(new String(b));
}
public void write(byte[] b, int a, int c) {
text.append((c > 2 ? new Date() +" - " : "") + new String(b,a,c));
}
}
}
/**
@param args
*/
public static void main(String[] args)
{
new TesteOutPutTrace();
}
}[/code]
OBS: Você pode ter isso em classes separadas, coloquei tudo como inner.