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);
}
}
答案 0 :(得分:1)
删除“System.exit(0);”从你的代码。此代码终止运行Java虚拟机(JVM)。