A
A
Artem Soshnikov2016-09-09 16:25:13
Java
Artem Soshnikov, 2016-09-09 16:25:13

What are the libraries for working with the console in Java?

I'm writing a simple console application in Java and I ran into the fact that I could not find information on this topic.
How to ask a user a question and get an answer in the console?
How to ask a multiple choice question?
How to display progressbar?
How to color the output?
Interested in approaches in one or two lines per task, by type:
superConsoleLib.askBoolean("Are u hungry?");
ArrayList variants = ...;
superConsoleLib.askSelect("select", variants);

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaly Vitrenko, 2016-09-09
@Vestail

I like Spring Shell . But there are no progressbars and colors.

M
mv200580, 2016-09-15
@mv200580

See www.crashub.org/.
A small article about this framework - https://habrahabr.ru/post/265741/.

I
igor_suhorukov, 2016-09-15
@igor_suhorukov

Take a look at lanterna , a java analogue of the curses library.
There is definitely a ProgressBar - com.googlecode.lanterna.gui.component.ProgressBar
I talked about crashub in a publication on Habré and this is about the ssh console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question