Console

Iam writing an application wherein i execute system commands ! like python file.py and i want to display the output in a small console or shell ! how can i acheive it ?Thanks and regards taggy
[227 byte] By [gnutaggya] at [2007-10-3 4:25:51]
# 1
JFrame with a JTextPane in it?
itchyscratchya at 2007-7-14 22:28:27 > top of Java-index,Desktop,Core GUI APIs...
# 2
yes how do i catch all that thats thrown usually on the terminal when i exectue my python script !
gnutaggya at 2007-7-14 22:28:27 > top of Java-index,Desktop,Core GUI APIs...
# 3
Hi,I think you can use the following methods:System.setOutSystem.setErr-Puce
Pucea at 2007-7-14 22:28:27 > top of Java-index,Desktop,Core GUI APIs...
# 4
Ah, no, I think for external processes you have to use:Process.getOutputStremProcess.getErrorStream(not tested)-Puce
Pucea at 2007-7-14 22:28:27 > top of Java-index,Desktop,Core GUI APIs...
# 5

yesi tried that ! i had a JTextarea and i was directing System.out and System,Err to the text area but iam only able to print out the commands i send or execute the output of my command is not to be found.

My python execution results in a set of strings to be printed on terminal .

can i actually start a konsole(system shell) from swing and direct all my commands to be exeecuted on that terminal so that i could easily see whats happening there !!!

gnutaggya at 2007-7-14 22:28:27 > top of Java-index,Desktop,Core GUI APIs...
# 6
Did you read my last post?
Pucea at 2007-7-14 22:28:27 > top of Java-index,Desktop,Core GUI APIs...
# 7
Use a ProcessBuilder to execute your script. Then use getOutputStream() on the resultant Process that this gives you.
timrba at 2007-7-14 22:28:27 > top of Java-index,Desktop,Core GUI APIs...