Java CLI UI-design: frameworks or libraries?(Java CLI UI 设计:框架还是库?)
问题描述
我目前正在开发一个只需要命令行界面的小型实用程序,并且我开始想知道 Java 是否提供了任何标准的创建 CLI 的方法,类似于用于 GUI 的 Swing 等.我对命令行参数和解析它们并不真正感兴趣,而是用户与程序使用它的基于命令的交互.这适用于 GUI 根本不需要或不是使用该程序的选项的情况.
I'm currently working on a small utility program that only requires a command line interface, and I started wondering if Java provided any standard way of creating the CLI, in a similar way that Swing and the likes exist for GUIs. I'm not really interested in command line parameters and parsing of them, but rather the command based interaction the user has with the program to use it. This is for the situations where GUI simply is unnecessary or not an option for using the program.
在谷歌上搜索该主题几乎只会得到关于如何使用 BufferedReader 等与用户进行基本交互的教程,旨在让人们学习 Java 的基础知识并编写简单的 UI,要求输入名称并打印Hello World!"等等.
Googling the subject pretty much only results in tutorials on how to use BufferedReader and the likes to do rudimentary interaction with the user, aimed at people learning the basics of Java and writing simple UI that asks for name and prints "Hello World!" etc..
是否有任何库专注于为快速实现更复杂的 CLI UI 提供良好的框架,或者这真的是每个人都以特殊方式为自己的实用程序实现的东西吗?
Are the any libraries that are focused on providing a good framework for quickly implementing a more complex CLI UI or is this really something that everyone implements in ad hoc manner for their own utilities?
也许有人知道在并非一切都是图形的时候创建的实现模式?这也是有用的资源.
Maybe someone knows of patterns for the implementation that were created back in time when not everything was graphical? That would also be useful resource.
推荐答案
也许是 CLI 工具包...
Perhaps CLI Toolkit...
http://alexis.royer.free.fr/CLI/
这篇关于Java CLI UI 设计:框架还是库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Java CLI UI 设计:框架还是库?
基础教程推荐
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 降序排序:Java Map 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01