Text-IO alternatives and similar libraries
Based on the "CLI" category.
Alternatively, view Text-IO alternatives based on common mentions on social networks and blogs.
-
Jansi
Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows. -
ASCII Table
Several implementations of a text table, originally using ASCII and UTF-8 characters for borders. -
Jexer
Advanced console (and Swing) text user interface (TUI) library, with mouse-draggable windows, built-in terminal window manager, and sixel image support. Looks like Turbo Vision.
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of Text-IO or a related project?
Popular Comparisons
README
Text-IO
Text-IO is a library for creating Java console applications. It can be used in applications that need to read interactive input from the user.
Features
- supports reading values with various data types.
- allows masking the input when reading sensitive data.
- allows selecting a value from a list.
- allows to specify constraints on the input values (format patterns, value ranges, length constraints etc.).
- provides different terminal implementations and offers a Service Provider Interface (SPI) for configuring additional text terminals.
By default, Text-IO tries to use text terminals backed by java.io.Console. If no console device is present (which may happen, for example, when running the application in your IDE), a Swing-based terminal is used instead.
Example
TextIO textIO = TextIoFactory.getTextIO();
String user = textIO.newStringInputReader()
.withDefaultValue("admin")
.read("Username");
String password = textIO.newStringInputReader()
.withMinLength(6)
.withInputMasking(true)
.read("Password");
int age = textIO.newIntInputReader()
.withMinVal(13)
.read("Age");
Month month = textIO.newEnumInputReader(Month.class)
.read("What month were you born in?");
TextTerminal terminal = textIO.getTextTerminal();
terminal.printf("\nUser %s is %d years old, was born in %s and has the password %s.\n",
user, age, month, password);
Click on the image below to see the output of the above example in a Swing-based terminal.
You can also use a web-based terminal, which allows you to access your application via a browser, as shown in the image below.
Useful links
Text-IO is available in Maven Central and JCenter.
*Note that all licence references and agreements mentioned in the Text-IO README section above
are relevant to that project's source code only.