What's a good Java, curses-like, library for terminal applications? [closed]
Asked Answered
G

5

118

I would like to write a Java terminal application that does screen manipulation. Are there any good libraries out there that allow you to manipulate the screen like curses in the *nix/C world?

Minimal features I'm looking for are windowing and user input support.

In feature-speak, I'd like to have a region of the terminal where some data is regularly updated while (at the same time) the user can enter commands/text in some other part of the screen.

Gesundheit answered 13/1, 2009 at 16:56 Comment(0)
L
37

There is Charva, which links to native code but has an api based on Swing. The screenshots show lots of text windows, so that looks useful.

Liman answered 13/1, 2009 at 17:6 Comment(4)
Nice one, too bad though that it requires native libraries. I'll give this a shot and see how far I get.Gesundheit
Last release: 2006.Xylophagous
@GrzegorzOledzki Just updating...Last release: 2013.Gav
@BartSchuller The link is dead.Wellfavored
N
65

Lanterna

I found the Lanterna library recently. Haven't had the opportunity to use it yet but it looks like a more up-to-date alternative to the others.

enter image description here

Negrito answered 15/10, 2012 at 13:21 Comment(3)
Thanks! I was looking for one that uses no native code.Hereunto
Last update was 4 months ago. Seems like the most recently maintained solution here.Bettis
Griffon is an application framework that supports 4 different UI toolkits: Swing, JavaFX, Apache Pivot, and Lanterna.Isometrics
L
37

There is Charva, which links to native code but has an api based on Swing. The screenshots show lots of text windows, so that looks useful.

Liman answered 13/1, 2009 at 17:6 Comment(4)
Nice one, too bad though that it requires native libraries. I'll give this a shot and see how far I get.Gesundheit
Last release: 2006.Xylophagous
@GrzegorzOledzki Just updating...Last release: 2013.Gav
@BartSchuller The link is dead.Wellfavored
T
26

Haven't used it myself, but Java Curses Library sounds like what you want.

Teel answered 13/1, 2009 at 16:58 Comment(5)
Sounds good, but I think I'll go with Charva, since that'll provide a more OO experience. Thanks for the suggestion.Gesundheit
Java Curses last release: 2002.Raimondo
Java Curses has now gotten some recent attention, and a new release in 2012.Unattended
Java Curses last release: 2012-12-07Gothenburg
Last Update: 2015-08-07. Note that this uses native code.Cohosh
L
10

Here is a way to call the ncurses lib using JNI. I tested this and it works.

Lamella answered 13/1, 2009 at 17:12 Comment(0)
H
8

As of 2013, the closest I can find is Blacken.

Blacken is not a curses library per-se. It moves away from the terminal, and instead, renders it's own "console window." This has the disadvantage of not looking "console-like." Instead, you get full (arbitrary) colour support, and a curses-like API (in addition to their main API).

You can also set the font to Mono for fixed-width characters.

Heterothallic answered 20/11, 2013 at 17:52 Comment(3)
Perfect for what I was wanting to do. Thank you.Gav
@jdersen there are some bugs in Blacken, but overall, it's quite good, and the owner responds quite quickly to opened issues.Heterothallic
Last release: Sep 27, 2012Gothenburg

© 2022 - 2024 — McMap. All rights reserved.