i have a command line based program that i want to write a gui based wrapper for. is there a way that i can redirect the stdout steam from that program to my gui and launch the other program with arguments?
thank you
i have a command line based program that i want to write a gui based wrapper for. is there a way that i can redirect the stdout steam from that program to my gui and launch the other program with arguments?
thank you
Yes. Invoke the program using Process
and grab the input / output / error stream of the process.(see an example here: http://www.rgagnon.com/javadetails/java-0014.html)
I am having some problems with formatting, so here are some relevant links:
try Apache common-exec, it provides an api to invoke commands and capture the stderr, sdtout and provide an stdin.