my login frame cannot link to my other frame

时间:2017-04-06 17:01:38

标签: java frame login-control

my login page exits but cannot redirect to the specified frame. i have researched it but still not working. it just exits but does not redirect. this is the part of the code for my login. They are all in the same package

 String use=user.getText();
       String ps=password.getText();
       if(e.getSource()==log){
         if((use.contains("emma"))&& (ps.contains("nana")))
        {   

       Stud now=new Stud();

        now.setVisible(true); 
        user.setText("");
        pass.setText("");

        // new   Stud ().setVisible(true);
           System.exit(0);
        }
         else{

       JOptionPane.showMessageDialog(null, "Invalid Inputs, PROVIDE PROPER CREDENTIALS", "ERROR", JOptionPane.ERROR_MESSAGE);
         }

    }

1 个答案:

答案 0 :(得分:1)

删除“System.exit(0);”从你的代码。此代码终止运行Java虚拟机(JVM)。