user6680
user6680

Reputation: 139

Redirecting .bat file to Java textarea

Is it possible to redirect a batch file being executed onclick with JButton and output the contents inside of a JTextArea and keep the cmd prompt window from appearing? So basically the JTextArea would serve as the console.

Upvotes: 0

Views: 77

Answers (1)

Juned Ahsan
Juned Ahsan

Reputation: 68715

Yes possible, you need to read the output+error streams from ProcessBuilder/Runtime and push the read contents to JTextArea.

Upvotes: 1

Related Questions