Java console cursor movemenet

痞子三分冷 提交于 2019-12-12 03:54:07

问题


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)


回答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.



来源:https://stackoverflow.com/questions/40576926/java-console-cursor-movemenet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!