Q: How to build a Java project with multiple main classes I have a project I am doing for a Computer Science class.  I have made a program that allows the user to create an account, and log in.  Once the person logs in, it opens a new window, and closes the old one.  I have it doing this by using a main class for the first login window, and a main class for the program window.  When I run the program in NetBeans, it works fine, but when I build it and run the .jar file it only opens up the login window even when I input the correct username and password and click login.  Is there any way I can build a Java project with multiple main classes and have it run them when I build it?

A: Personnally, I don't undertand why you would need several main classes. You only need one main to start your application. Once it is done, you can open and close windows from other classes.
