Reputation: 1251
I made a command-line chat client with Java, that sends the messages from stdin to the server and, at the same time, receives messages from the server to stdout at the same time. It's likely that somebody may send a message while you're writing one, so I want the bottom line of the terminal always reserved for input, so that output appears above it. I hope you understand my question and I apologize in advance if you don't.
Upvotes: 0
Views: 493
Reputation: 14371
The JCurses library will do exactly what you need.
http://sourceforge.net/projects/javacurses/
It's a Java implementation of ncurses from the *nix operating systems. On Windows, you'll need to include the .dll files, on most linux distros, you don't need to do anything except include the jar in your classpath.
The reason you need a library to build a "command line gui" is because standard java is not capable of manipulating the local command line in this fashion. This is likely due to how Java is not built for a specific platform - but that's just a guess.
Upvotes: 1