• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

text field validation

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

------------------
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic