• Post Reply Bookmark Topic Watch Topic
  • New Topic

text field validation

 
karai baskar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to validate text fields in a registration form which is created in swing.
suppose user leaves the field empty ,a alert message should be displayed and the cursor point should be in particular field
help me in doing this immediately .
thanks a lot
baskar

------------------
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi baskar,
you can add focusListener to your textfield and then check for the validity of data in lostFocus() event for the text field.
or for a more sophisticated validation visit this link. http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html#validation

regards
Deekasha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!