Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

input field validation  RSS feed

 
Mike Stead
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using SWING to make GUIs ect... But I'm not sure how to go about validating the data that is entered in the text fields before I insert the values into the database that I've set up.
Can anyone give me any guidance or advice?
Validation of String (ie. if the max number of characters is 50) Stuff like that.
Thanks! And Happy Holidays!
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the validated textfield section of the tutorial.
 
basha khan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use custom coding(by using substring(),equals()) rather than searching for API methods for these kind of small probloms.use collections also for temporary storage before commiting the data to the database.
basha
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!