shivshnkr
shivshnkr

Reputation: 1465

Java : Interactive Console using jTextArea

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

Answers (1)

Aubin
Aubin

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

Related Questions