troubleshooting Question

How to call another class from main class

Avatar of guavamay
guavamay asked on
Editors IDEsJava
2 Comments1 Solution435 ViewsLast Modified:
I am calling my login class from my main class which is working. But I am not sure how to code to call my MainMenu class after I login successfully!
All the three classes are in same package. My login class has the connection code and my MainMenu class has tabbed pane which I am going to code later on. What I want to achieve at this point is to run main class which will display my login screen, after logged in successfully, display my MainMenu screen.  Can I add to call MainMenu class, the same way I am calling login in my main class
Could someone please help me?

Here is my code looks like in main class..

public class MyappMainClass {
    //Main method-need to add so that this class execute first
    public static void main(String[] args) {
        //Add method to call my login class from here
       java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Login().setVisible(true);

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros