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?
Asked
Active
Viewed 2,216 times
1
-
http://stackoverflow.com/questions/3976514/multiple-runnable-classes-inside-jar-how-to-run-them – Anirban Nag 'tintinmj' Dec 01 '13 at 20:49
-
1Why not just create a new instance of "your main application" `JFrame` on successful login? – Elliott Frisch Dec 01 '13 at 20:53
-
I am not convinced that you understand what the problem is. How about you post your code, that will be the fastest way to solve this problem. – Robin Green Dec 01 '13 at 22:55
1 Answers
0
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.

C.Champagne
- 5,381
- 2
- 23
- 35
-
From looking at the posted comments, I think I understand what I have to do so I won't be needing any more help! Thanks for your guys help! – Code Monkey Dec 01 '13 at 23:36