private void cmdloginActionPerformed(java.awt.event.ActionEvent evt) {
if (txtusername.getText().equalsIgnoreCase("test") && txtpass.getText().equalsIgnoreCase("123")){
if (chkremember.isSelected()){
lblmessage.setText("Login successful with remembering option");
}else{
lblmessage.setText("Login successful without remembering option");
}
}else{
lblmessage.setText("Login Failed");
}
}
private void cmdloginActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String userName = txtusername.getText();
String password = txtpass.getText();
if (userName.trim().equals("admin") && password.trim().equals("admin")) {
lblmessage.setText("Hello" + userName +"");
}else{
lblmessage.setText("Invalid User");
}
}
private void cmdresetActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
lblmessage.setText("");
txtusername.setText("");
txtpass.setText("");
}
Cairo-Coders is the one place for high quality web development, Web Design and software development tutorials and Resources programming. Learn cutting edge techniques in web development, design and software development, download source components and participate in the community.
Java Swing JPasswordField & JCheckBox Usage - Login Example Tutorial
Java Swing JPasswordField & JCheckBox Usage - Login Example Tutorial
