Lanterna

 

Lanterna is a Java library for writing GUIs in a text-only environment, very similar to the C library ncurses, but with more functionality. Lanterna is structured into three layers:

  1. A low level terminal which gives you control over the terminal window as a kind of text area.
     
  2. The second level is a screen buffer, which makes writing similar to modifying a 2D array of characters.
     
  3. The third level is a GUI toolkit with windows, buttons, labels, and other components.

My examples focus on the second and third levels by using Lanterna's screen and gui2 packages for the most part, along with some helper functions stored in Utils.java and SoundUtils.java.

The code has been tested on MS Windows and Linux, and I've included a few screenshots of the more graphically interesting examples, most of which were snapped on Linux accessed from MS Windows via a putty terminal.

Screen-based Examples

GUI-based Examples

Other Downloads and Links


Dr. Andrew Davison
E-mail: ad@coe.psu.ac.th
Back to the third-party libraries page