Reputation: 1465
I am developing a cmd like console using jTextArea, for an IDE. What I want to do is as I click the execute button, it provides me interactive input/output screen in the jTextArea.
I am able to grab the output contents of the cmd screen, but what if user wants to run a command like take two integers as input from stdin (here from my jTextArea) and display the sum, on my console screen, as if it happened in a normal cmd/terminal.
How do I send input to that instance/session?
Upvotes: 2
Views: 357
Reputation: 14863
See java.lang.Process, method java.lang.Process.getOutputStream()
The name OutputStream
is a doubtful choice because it's the input of the underlying process, the output for your program.
Upvotes: 1