Favicon of Lanterna

Lanterna

Java library for creating semi-graphical terminal user interfaces with cross-platform support. Works in xterm-compatible terminals and includes a Swing emulator for IDE development.

Lanterna is a pure Java library that lets you create sophisticated text-based user interfaces without relying on any native code. Unlike traditional terminal libraries, it works seamlessly across different environments—from xterm-compatible terminals like konsole and gnome-terminal to Windows and graphical systems using an embedded Swing terminal emulator.

The library is organized into three flexible layers that you can use independently or together:

  • Terminal Layer: Low-level cursor control and character modifiers for direct terminal manipulation
  • Screen Layer: Full-screen buffering that treats the terminal like a bitmap, letting you write changes in memory before flushing to the display
  • GUI Toolkit: Complete component library with windows, buttons, labels, and a modal window management system for rapid UI development

Key advantages include 100% Java implementation with no external dependencies, seamless development in IDEs that don't support ANSI characters, and identical code deployment from development machines to headless servers. The library is actively maintained, available through Maven Central, and supported by comprehensive documentation and JavaDoc references.

Features

ScriptableTrue color

Media

Pros

4
  • Pure Java implementation, no native dependencies.
  • Cross-platform support with Swing emulator for IDE development.
  • Offers multiple layers of abstraction for terminal control.
  • Provides a GUI toolkit with common components.

Cons

1
  • May not support all advanced terminal features of modern emulators.

Related tools

Categories:

Share:

Auto-fetched .

Similar to Lanterna

Favicon

 

  
 
Favicon

 

  
 
Favicon