空指针异常 求助啊
TSAB 2017-11-18 07:26:21 这是错误代码,getTexct()处错误
public void actionPerformed(ActionEvent e){
if(e.getSource()==enterBtn){
String account=accountField.getText();
String password=new String(passwordField.getPassword());
if(account.trim().length()==0||password.trim().length()==0){
JOptionPane.showMessageDialog(null, "用户名密码不允许为空");
return;
}
if(accountField.getText().trim().equals("zkz")&&new String(passwordField.getPassword()).trim().equals("cj")){
JOptionPane.showMessageDialog(null, "登录成功");
this.dispose();
}
else{
JOptionPane.showMessageDialog(null, "用户名或密码错误");
}
}
if(e.getSource()==exitBtn){
System.exit(1);
return ;
}