简体   繁体   English

Java Netbeans如何在jar文件中启动gui运行

[英]Java netbeans how to make a gui run at starting in the jar file

So I have made a new Application in Java Netbeans. 因此,我在Java Netbeans中创建了一个新应用程序。 I made the "Main UI" of the application in my first JFrame Form. 我在第一个JFrame表单中创建了应用程序的“主界面”。 Then I started making another JFrame "Login UI". 然后,我开始制作另一个JFrame“登录UI”。 Now I want the "Login UI" to run first in my jar file. 现在,我希望“登录UI”首先在我的jar文件中运行。 But by default it is running the first "Main UI". 但是默认情况下,它正在运行第一个“主UI”。 I just simply want to run My second UI "Login UI" first. 我只想先运行我的第二个UI“登录UI”。

Open the Login UI java file and press Shift+F6. 打开登录UI Java文件,然后按Shift + F6。 That command will run the file that is open if it has a main method. 如果该命令具有main方法,它将运行打开的文件。

PS: To permanently make that class the project's main class, right click the project, select Properties, select Run on the left, and change the Main Class option. PS:要使该类永久成为项目的主类,请右键单击该项目,选择“属性”,选择左侧的“运行”,然后更改“主类”选项。

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

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