什么是用于终端应用程序的优秀 Java、类似curses 的库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/439799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's a good Java, curses-like, library for terminal applications?
提问by Francisco Canedo
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?
我想编写一个执行屏幕操作的 Java 终端应用程序。有没有什么好的库可以让你像 *nix/C 世界中的诅咒一样操纵屏幕?
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.
在功能方面,我希望有一个终端区域,其中一些数据会定期更新,同时(同时)用户可以在屏幕的其他部分输入命令/文本。
采纳答案by Bart Schuller
There is Charva, which links to native code but has an api based on Swing. The screenshotsshow lots of text windows, so that looks useful.
有Charva,它链接到本机代码,但有一个基于 Swing 的 api。该截图显示大量的文本窗口,所以这看起来是有用的。
回答by Jim Blizard
Haven't used it myself, but Java Curses Librarysounds like what you want.
自己没用过,但Java Curses 库听起来像你想要的。
回答by DMKing
回答by Bryce
回答by ashes999
As of 2013, the closest I can find is Blacken.
截至 2013 年,我能找到的最接近的是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).
Blacken 本身并不是一个诅咒库。它远离终端,而是呈现它自己的“控制台窗口”。这具有看起来不像“控制台”的缺点。取而代之的是,您可以获得完整的(任意)颜色支持和一个类似 curses 的 API(除了它们的主要 API)。
You can also set the font to Mono
for fixed-width characters.
您还可以将字体设置Mono
为固定宽度字符。