java - Contact number validation -


i want validate contact no text field checking if contains digit. have written following function keytyped not working can provide alternative.thanks in advance.

code:-

private void tnokeytyped(java.awt.event.keyevent evt) {     char c=evt.getkeychar();     system.out.println("hi");     if(!(character.isdigit(c)||(c==keyevent.vk_back_space)||(c==keyevent.vk_delete)))     {         evt.consume();     } } 

i want validate contact no text field checking if contains digit

you can post validation on field using inputverifer, see validating input more details.

i have written following function keytyped not working can provide alternative

you can real time validation through use of documentlistener, see implementing document filter , documentfilter examples more details


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -