[java] Redirecting System.err to a JTextArea???

Started by
4 comments, last by ServantOfGlaaki 20 years, 1 month ago
Hi there, How can I redirect the output from System.err to a JTextArea? Cheers Stu
And a woman needs a man... like a fish needs a bicycle...[U2 - Tryin' to throw your arms around the world]
Advertisement
Hmm, quick idea would be to write your own class that extends PrintWriter and set it as the System.err output. Then have the new class pipe its output into a text field of your choice.
This is something that is covered in the Java tutorial on Sun''s site. Since I have not added the link to the FAQ yet, I''ll allow this thread to remain open, but in the future, questions such as these should be attempted on your own first.

http://chaos.webhop.org
Strife,

Whereabouts would I find it one the Java tutorial? I''ve searched it, but can''t seem to see it.

Cheers
Stu
And a woman needs a man... like a fish needs a bicycle...[U2 - Tryin' to throw your arms around the world]
Go right to the source.

http://java.sun.com/docs/books/tutorial/index.html


First make it work, then make it fast. --Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
Sorry, I meant to actually link to that when I posted... However, I have no added it to the FAQ for future reference.

http://chaos.webhop.org

This topic is closed to new replies.

Advertisement