Re: PrintWriter output to GUI



"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('$','@')


.



Relevant Pages

  • Re: PrintWriter output to GUI
    ... Is it possible to re-engineer an existing app that now statically creates ... Looking for insight and a code snippet. ... System.setOutmethod, and give it a PrintStream, which writes into a GUI component. ...
    (comp.lang.java.gui)
  • Re: run client program when the system is on
    ... A dialog-based app is remarkably ill-suited for being a service. ... There are lots of articles, including MSDN articles, on creating a service. ... which has not a single GUI component anywhere in it. ... there is any code to help run as service.I got some code.But I dont ...
    (microsoft.public.vc.mfc)
  • PrintWriter output to GUI
    ... Is it possible to re-engineer an existing app that now statically creates a ... PrintWriter and outputs System.out to it with output_.printlnto go to a ... scrollable GUI component? ... I believe not b/c no Swing app would have the ...
    (comp.lang.java.gui)