Is it possible to create an editable command line prompt in Java?
At the moment my command line looks like the following:
Scanner scanner = new Scanner(System.in);
System.out.format("Enter new value, press Return for keeping old value [%s]:", oldValue);
String newValue = scanner.next();
EDIT:
While this should works under normal circumstances, I likely would have a command line, that populate the old value and let me edit it and finally take the new value on pressing Return; something like an editable TextField for the console.
I have tried jLine2 with something like this:
ConsoleReader reader = new ConsoleReader;
reader.putString("2");
String input = reader.readLine();
...but unfortunately, this hides the value 2
until I press Key "2" and deletes the whole line on backspace... And because of the very poor documentation of jLine2 on Github, I have no idea if this is even possible?