0

Can I move the cursor somehow in Java console ?

I would like to print out a whole page and move the cursor back and the user can fill out the form.

For example:

Username:         .......
Password:         .......
Re-enter passwor: .......

When the user first start typing it supposed to appear on the first dotted line, presses Enter, then the second dotted line and so on.

Does anyone has got a solution for this? (A single "return carriage" for the whole console would be more than enough for me)

Mehhhh.
  • 183
  • 1
  • 1
  • 12
  • 2
    Possible duplicate of [What's a good Java, curses-like, library for terminal applications?](http://stackoverflow.com/questions/439799/whats-a-good-java-curses-like-library-for-terminal-applications) – Herb Nov 13 '16 at 17:53

1 Answers1

1

Not easily. You'd need JCurses or similar library for that.

Text mode isn't so popular anymore, so the support for that kind of functionality is poor. It's easier to switch to graphical environment instead.

Kayaman
  • 72,141
  • 5
  • 83
  • 121
  • I know, I usually use JavaFX, but it is a homework at the university and they explicitly asked for a command line program. :-( – Mehhhh. Nov 13 '16 at 17:57
  • If they didn't ask for such functionality, you'll save yourself a lot of trouble by making it very basic with regard to appearance. – Kayaman Nov 13 '16 at 17:59