简体   繁体   English

Java GUI界面

[英]Java GUI Interface

At the minute I'm creating a GUI which allows the user to add, remove, modify and update CV's which they get in from people. 目前,我正在创建一个GUI,允许用户添加,删除,修改和更新从人们那里获得的简历。 So in other words the GUI takes there name, email, years of experience, degree and so on. 因此,换句话说,GUI带有名称,电子邮件,多年经验,学位等。 My question is how can I open the GUI outside Eclipse with out running Eclipse at all so the user can just click on the GUI on there desktop and interact with it. 我的问题是,如何在Eclipse外部完全不运行Eclipse的情况下打开GUI,以便用户只需单击该桌面上的GUI并与之交互。

If you could answer this it would be of great help. 如果您能回答这个问题,那将有很大的帮助。

Thanks. 谢谢。

You can run executable JARs if you export them from Eclipse as " Runnable JAR file ". 如果从Eclipse将可执行JAR导出为“可运行JAR文件 ”,则可以运行它们。
But first, you need to set up a Running Configuration for your project ([Context Menu] > Run As> Run Configurations...) where you need to define the class where is located the project's "main". 但是首先,您需要为项目设置“ 运行配置 ”([上下文菜单]>“运行方式”>“运行配置...”),在其中需要定义项目“主”所在的类。
You also should package required libraries into the generated JAR but you need to make sure that, in the project's Properties -> Java Build Path all external libraries (except JRE System Library) are checked in the "Order And Export" Tab. 您还应该将所需的库打包到生成的JAR中,但是您需要确保在项目的“属性”->“ Java构建路径”中,在“订购和导出”选项卡中选中所有外部库(JRE系统库除外)。

Then locate your generated jar in the file system and double click it to run. 然后在文件系统中找到生成的jar,然后双击运行。

Tip: if nothing happens, run it on the console using "java -jar [generatedFileName].jar" to check if the are exceptions being thrown. 提示:如果什么都没有发生,请使用“ java -jar [generatedFileName] .jar”在控制台上运行它,以检查是否抛出了异常。

Select your project, then Right Click Export -> Java -> Runnable JAR file 选择您的项目,然后右键单击 Export -> Java -> Runnable JAR file

You can then choose to extract/package/copy required libraries into your JAR and also select the class, whose main() method should be executed on startup. 然后,您可以选择所需的库提取/打包/复制到JAR中,还可以选择类,该类的main()方法应在启动时执行。

Then you can execute the generated jar via: java -jar yourjar.jar 然后,您可以通过以下命令执行生成的jar: java -jar yourjar.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM