Re: PrintWriter output to GUI
- From: "Thomas Fritsch" <i.dont.like.spam@xxxxxxxxxxx>
- Date: Tue, 26 Jul 2005 22:30:45 +0200
"C P via JavaKB.com" <forum@xxxxxxxxxx> wrote.
>
> Hello
> Is it possible to re-engineer an existing app that now statically creates
> a
> PrintWriter and outputs System.out to it with output_.println() to go to
> a
> scrollable GUI component? I believe not b/c no Swing app would have the
> println method and I dont see how you to force it; however I am naive one
> asking the question. Looking for insight and a code snippet. tia.
It is actually quite simple. The key is the
System.setOut(PrintStream)
method, and give it a PrintStream, which writes into a GUI component.
Try <http://www.google.de/search?q=System.setOut+%2Bswing>
to find some implementations of this approach.
--
"TFritsch$t-online:de".replace(':','.').replace('$','@')
.
- Follow-Ups:
- Re: PrintWriter output to GUI
- From: C P via JavaKB.com
- Re: PrintWriter output to GUI
- References:
- PrintWriter output to GUI
- From: C P via JavaKB.com
- PrintWriter output to GUI
- Prev by Date: PrintWriter output to GUI
- Next by Date: Re: PrintWriter output to GUI
- Previous by thread: PrintWriter output to GUI
- Next by thread: Re: PrintWriter output to GUI
- Index(es):
Relevant Pages
|