Re: How create a console using java graphical interface



behnaz wrote:
Hi,

I am wondering if there is any simple way for creating a console that
outputs an application
results using java graphical interface.I don't wanna use netbeans or
a stuff like that,just a
standard way.
help me please......
B.



java.lang.System.setOut() and java.lang.System.setErr() will allow you to change standard output and standard error streams to something else, like the afore mentioned JTextArea. (Not automagically, you'll have to write some code to get it all to work properly.)

You CAN still also just write to .out and .err. Even though your application uses a GUI, the console streams are still there. To use them, open a command line window and run your app (or any app) from the command line. You'll see the output as the program runs.

Finally, I think the best way to actually capture print-like streams is to use the Logger.

http://java.sun.com/javase/6/docs/api/java/util/logging/Logger.html

Lot's of info and tutorials available for the latter, I won't duplicated them here. GIYF.
.



Relevant Pages

  • StreamReader problem. What am I doing wrong?
    ... I'm trying to build an app that will interact with various ... console applications. ... commands to the standard input stream, and retrieve output from the standard ... standard output stream. ...
    (microsoft.public.dotnet.framework)
  • Re: No, POLL and WAIT
    ... > The WaitForSingleObjectEx function returns when one of the following ... Yes, you can wait on a file handle that refers to a console, and yes in many ... > The GetStdHandle function returns a handle for the standard input, ... or by the GetStdHandle function. ...
    (alt.lang.asm)
  • Re: Read a single byte from stdin
    ... standard input without involving AWT or Swing? ... System streams and Console, but both are doing line buffering and neither ... simulate a console that could read a character at a time. ... real command processor console? ...
    (comp.lang.java.programmer)
  • Re: getting out of LaTeX
    ... And, as the standard states, when there is agreement between the ... The ASCII standard of 1963 already ... 016 0E SO Shift Out ctrl-N ... the idea of files as byte streams. ...
    (sci.lang)
  • Re: NEW_LINE()
    ... I don't recall ever using text streams in my own code. ... standard, then other non-standard extensions (like some kind ... > I/O can still have a record length limit. ... > a line buffer to be written out with a record mark at the end. ...
    (comp.lang.fortran)