Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to get text user-interfaces (ncurses-like) functionality in Java?

Tags:

I need to implement a console application (possibly in Java) with ncurses-like functionality (such as navigating a menu and redrawing the whole screen).

The only solutions that I can find to do this so far are CHARVA ("A Java Windowing Toolkit for Text Terminals"), tuipeer ("A Text User Interface for the Java AWT") and a really old Dr. Dobb's article ("A Text UI for the Java AWT ").

So far, CHARVA is the best thing that I can find but I don't like the idea of it using JNI to wrap curses.

Is there any standard way, say with AWT/Swing, to do do this? What other alternatives are there?

like image 289
Anthony Avatar asked Aug 24 '09 09:08

Anthony


1 Answers

Since 2010 there is Lanterna :

Lanterna is a Java library allowing you to write easy semi-graphical user interfaces in a text-only environment, very similar to the C library curses but with more functionality. Lanterna is supporting xterm compatible terminals and terminal emulators such as konsole, gnome-terminal, putty, xterm and many more. One of the main benefits of lanterna is that it's not dependent on any native library but runs 100% in pure Java.

More here: https://github.com/mabe02/lanterna

like image 114
Waldemar Wosiński Avatar answered Sep 17 '22 20:09

Waldemar Wosiński