Create Java Command Console in JPanel(在 JPanel 中创建 Java 命令控制台)
问题描述
我想创建一个类似于 Windows 命令提示符的命令控制台",其中包含 JPanel 中的命令历史记录等,以便可以将其添加到 JFrame.
I want to create a "Command Console" similar to the Windows Command Prompt, with command history, etc which is in a JPanel so that it can be added to a JFrame.
我想要做的是向用户显示允许他们执行命令的提示.
What I want to do is present the user with the prompt to allow them to execute commands.
我的想法类似于 BeanShell 控制台,但是我无法找到控制台的源代码.
What I have in mind is similar to the BeanShell Console, however I haven't be able to find the source code for the console.
推荐答案
要将 BeanShell 包含到您的应用程序中,请添加 BeanShell 下载页面 到您的 Java 项目并查看 BeanShell 文档部分从您的应用程序调用 Beanshell" 以了解如何通过直接调用或通过评估您的 shell 中的命令来调用 Beanshell.
To include BeanShell into your application, add the .jar-files from the BeanShell download page to your Java project and see the BeanShell doc section "Calling Beanshell from your Application" for examples how to call Beanshell with direct calls or by evaluating the commands from your shell.
另请参阅快速入门指南了解如何使用的其他方式和示例豆壳.
See also the Quickstart Guide for other ways and examples how to use BeanShell.
这篇关于在 JPanel 中创建 Java 命令控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 JPanel 中创建 Java 命令控制台


基础教程推荐
- 大摇大摆的枚举 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 从 python 访问 JVM 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01