问题
I am interested in creating a text-based game in Java and am wondering how I would replicate the common server console (ie: nogui server mode in the minecraft-server for example) - as in there is always a line at the bottom of the console for input, and everything else above it is output which can be written to asynchronously.
How would I get started on this? I am unfamiliar with the terminology regarding this sort of stuff and also what libraries to use to begin with.
回答1:
You should take a look to Java curses library. I haven't use it but, it looks like what you want.
回答2:
This library may well be helpful: I created it in order to implement a small Rogelike game in Java:
- https://github.com/mikera/swing-console
It uses Swing to create a simulated console-style window.
来源:https://stackoverflow.com/questions/12619676/java-programming-a-two-way-console-window