title: Command line interface within Java GUI
body: <p>I want to implement a command line interface within the Java GUI window. Is there a good way of doing this or an existing project/example I could use?</p>
  
  <p>My application visualises a graph in the GUI and I would like to enter verbal commands for editing it, instead of developing a point-and-click interface for every possible command. It would be similar to a normal command line but I would have a custom parser that analyses the entered command strings. </p>
  
  <ul>
  <li>You can write your command and press enter, upon which the string is sent to a listener for parsing and execution.</li>
  <li>Show a scrollable history of previous commands.</li>
  <li>After parsing I might want to print something onto the screen (which would go to the history area).</li>
  <li>Perhaps a command-line-style prefix (">").</li>
  <li>Ability to edit the current command (backspace) before submitting it (enter). Not being able to delete the prefix or previous commands in the history.</li>
  <li>Up and down keys would allow navigating and repeating previous commands.</li>
  </ul>