How to verify the JComponents

108 Views Asked by At
public void actionPerformed(ActionEvent ae){
   String userName = userNameTxt.getText();
   char[] pass = password.getPassword();

}

I want to validate the above fields( its username and password) I want to take only alohabet(a-z) in username and a-z, 0-9 in password how to do this ? I am new to swing

0

There are 0 best solutions below