0

I'm making finishing touches on one of my programming homework problems, and I'd like to make my program list the kind of units directly after the input in the terminal input, before the user actually enters the input itself.

Essentially, I'd like to make the system output the following line in the terminal window, with [] being a blinking cursor for the user's next input:

Input a number in inches: [] inches

Any ideas?

4

1 回答 1

1

Java's console is not designed for interactive cursor manipulation like this. You need to either use a JNI library, or a GUI interface, neither is a trivial change. If this is just homework, I suggest you consider something simpler like having the units before the number.

于 2013-09-08T21:28:59.207 回答