简体   繁体   中英

Place input while printing output with java jline

How can i place input text at the same time text is also being printed out without it effecting what i have placed?

I'm trying to make a server where there is constant debugging information being printed, but at the same time i want to be able to execute commands while still seeing the information being displayed, but have it done without effecting the info that is already typed in the input field. (Minecraft Bukkit is an example)

Example: http://i43.tinypic.com/2e1ufzp.gif

You will need two threads. The main thread (where your application lives) and outputs all the info as it needs, and another one just for input.

EDIT:

You will need to take some special care if your application prints something while you are writing, as there will be characters being printed in the front of what you were writing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM