flyclassic22
Technical User
hi, i'm doing a project with java updating a msaccess database. before going into updating database with sql , i need to validate the string input by user,
i need some help on how do i valid a string input by a user(jtextfield). The string is suppose to be a date to be entered. and following format DD/MM/YY .
First: How do i check to see if user enter in the correct format and not having characters like "A, B, C" and following the format is state.?using substring? i need examples to let me learn how to do it....
2nd: Check if the date is valid if the string is in correct format
I've read examples of SimpleDateFormat, but not very sure how to use it validate , i've an example but it has time in it, but i do not want the format to have time, i just want the date.
3rd: Once i get the date in string, can anyone tell me the concept of going about doing taking the "now" date and compare with the date user has enter(DOB) and use it to calculate the age of the user.
Anyone who have tutorials, sample advice or anything that can help any of my three question please kindly help me!
I'm newbie to JAVA. I appreciate every tip received. THANKS in advance.
i need some help on how do i valid a string input by a user(jtextfield). The string is suppose to be a date to be entered. and following format DD/MM/YY .
First: How do i check to see if user enter in the correct format and not having characters like "A, B, C" and following the format is state.?using substring? i need examples to let me learn how to do it....
2nd: Check if the date is valid if the string is in correct format
I've read examples of SimpleDateFormat, but not very sure how to use it validate , i've an example but it has time in it, but i do not want the format to have time, i just want the date.
3rd: Once i get the date in string, can anyone tell me the concept of going about doing taking the "now" date and compare with the date user has enter(DOB) and use it to calculate the age of the user.
Anyone who have tutorials, sample advice or anything that can help any of my three question please kindly help me!
I'm newbie to JAVA. I appreciate every tip received. THANKS in advance.