Search code examples
javalinuxpretty-print

Pretty printing using java for unix console


I'm writing a small server designed to handle just a few clients. For every connection the server starts a new thread and does some work.

I want to be able to print information about what the server is doing, seperated in columns so that you can see what information belongs to a specific thread/client.

Something like this:

thread 1              thread 2                   thread 3
-----------------------------------------------------------
task 1                 task 7                     task 2
[====>    ] 50%        ops! something happend     task 2.1
                                                  task 3

So I want to be able to update, remove or add a line in each column during runtime. Is there any libs out there that I can use? It does only have to work in linux terminals.


Solution

  • You'll need to either find an ncurses library for java or get real familiar with terminal escapes.