Alex Rivera | Logout

Create a "Command" Console

Asked 2009-08-10T14:53:39.767
11

I have a bit of an unusual question: How can I create a "Command Console" using Swing?

What I want to have is a console where the users type in commands, press enter, and the output from the command is displayed under. I don't want to allow the user to change the "prompt" and older output. I am thinking of something like Windows CMD.EXE.

I had a look at this question, however it doesn't answer my question.

Edit
Report

1 Answer

0

You can execute arbitrary commands with Plexus using Commandline. It handles escaping of the arguments, environment specific execution, and allows you to attach consumers to stdout and stderr, leaving you to focus on the handling.

Here's a link to another answer I gave, showing how you can set up a Commandline and handle the output.

answered 2009-08-10T14:59:04.360

Your Answer