String name = jTextField3.getText();
for(int i=0 ; i<=name.length() ; i++)
if ( name.charAt(i) >= "0" )
return false;
return false;
i have boolean method that if in jTextfield3 get text a number then it will return true or false.
and then i have another code in button click\ if(isValidName==false) JOptionPane.ShowDialogMessage(this, "Name isn't Valid);
Aucun commentaire:
Enregistrer un commentaire