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?
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.
- You can write your command and press enter, upon which the string is sent to a listener for parsing and execution.
- Show a scrollable history of previous commands.
- After parsing I might want to print something onto the screen (which would go to the history area).
- Perhaps a command-line-style prefix (">").
- Ability to edit the current command (backspace) before submitting it (enter). Not being able to delete the prefix or previous commands in the history.
- Up and down keys would allow navigating and repeating previous commands.
JTextAreasandJTextFields. :(