Re: How create a console using java graphical interface
- From: Mark Space <markspace@xxxxxxxxxxxxxx>
- Date: Thu, 27 Sep 2007 12:01:13 -0700
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.
.
- References:
- How create a console using java graphical interface
- From: behnaz
- How create a console using java graphical interface
- Prev by Date: How to test a text file is newly created?
- Next by Date: Re: 102nd Birthday of E=mc2 ( 27 Sep 1905- 27 Sep.2007) Complete tribute in book Einstein's E=mc2 generalized , www.ajayonline.us
- Previous by thread: How create a console using java graphical interface
- Next by thread: Re: How create a console using java graphical interface
- Index(es):
Relevant Pages
|