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 命令控制台
基础教程推荐
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01