如何在JFrame中启动命令行Java代码? [英] How to launch command line Java code inside a JFrame?

查看:166
本文介绍了如何在JFrame中启动命令行Java代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过基本命令行界面执行的Java程序.我想知道将其放在窗口JFrame中.是否有可能? 我该怎么办?

I have a Java program which is executed through the basic command line interface. I am wondering about put it in a window JFrame. Is it possible? How can I do?

谢谢.

推荐答案

如果要在jFrame中使用命令行,我认为这不是一个好主意.如果启动了JFrame,则意味着程序已经启动.您必须使用命令行或运行可执行的jar文件来启动程序.因此,您要做的事情没有任何意义.

If you want command line inside a jFrame I think it is not a good idea. If the JFrame is started that means the program is already started. You have to start the program using command line or running a executable jar file.So there is no meaning in what you are going to do.

如果要在JFrame中而不是在命令行中查看输出,则可以这样做.您可以在此处中查找摆动程序的详细信息

If you want to see your output inside a JFrame rather than in the command line, that can be done. You can look here for details of swing programmimng

这篇关于如何在JFrame中启动命令行Java代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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