使用不注释的代码可以执行,但是换成注释的代码就没有结果显示出来了
final private String user = "1";
final private String password = "2";
public void actionPerformed(ActionEvent e){
if (e.getSource()==loginJB){
if(userJTF.getText().equals(user) && new String( passwordJPF.getPassword()).equals(password))
studentLogin();
else{
System.out.printf("user/password is wrong or does't exist");
}
}
if (e.getSource()==clearJB){
userJTF.setText("");
passwordJPF.setText("");
}
}
/*public void actionPerformed(ActionEvent e){
if (e.getSource()==loginJB){
if(userJTF.getText()==user && new String( passwordJPF.getPassword())==password)
studentLogin();
else{
System.out.printf("user/password is wrong or does't exist\n");
}
}
if (e.getSource()==clearJB){
userJTF.setText("");
passwordJPF.setText("");
}
}
*/
final private String user = "1";
final private String password = "2";
public void actionPerformed(ActionEvent e){
if (e.getSource()==loginJB){
if(userJTF.getText().equals(user) && new String( passwordJPF.getPassword()).equals(password))
studentLogin();
else{
System.out.printf("user/password is wrong or does't exist");
}
}
if (e.getSource()==clearJB){
userJTF.setText("");
passwordJPF.setText("");
}
}
/*public void actionPerformed(ActionEvent e){
if (e.getSource()==loginJB){
if(userJTF.getText()==user && new String( passwordJPF.getPassword())==password)
studentLogin();
else{
System.out.printf("user/password is wrong or does't exist\n");
}
}
if (e.getSource()==clearJB){
userJTF.setText("");
passwordJPF.setText("");
}
}
*/