How to create an editable command line prompt in Java? -


is possible create editable command line prompt in java?

at moment command line looks following:

scanner scanner = new scanner(system.in); system.out.format("enter new value, press return keeping old value [%s]:", oldvalue); string newvalue = scanner.next(); 

edit:

while should works under normal circumstances, have command line, populate old value , let me edit it , take new value on pressing return; an editable textfield console.

i have tried jline2 this:

consolereader reader = new consolereader; reader.putstring("2"); string input = reader.readline(); 

...but unfortunately, hides value 2 until press key "2" , deletes whole line on backspace... , because of poor documentation of jline2 on github, have no idea if possible?

you use external library that, e.g. https://github.com/jline/jline2/wiki/jline-2.x-wiki


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -