public void jButton1_actionPerformed(ActionEvent e) {
String Sql = "";
Statement st = sql.Connect();
String name = this.jTextField1.getText();
char[] x = this.jPasswordField1.getPassword();
String pwd = new String(x);
if (this.jTextField1.getText() != null ||
this.jPasswordField1.getPassword() != null) {
Sql = "INSERT INTO info (UName,UPwd) values ('" + name +
"','" + pwd + "')";
} else {
JOptionPane.showMessageDialog(this, "请输入用户名或密码");
}
try {
st.executeUpdate(Sql);
st.close();
sql.close();
} catch (SQLException ex) {
}
}
红色部分要怎么写,才能使我的验证框在没有任何数值的情况下提示我
输入用户名和密码呢?
知道的朋友帮帮忙,万分感谢