在 JPanel 中创建 Java 命令控制台 [英] Create Java Command Console in JPanel

查看:40
本文介绍了在 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 命令控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆