In this lab, you will work with a GUI to validate the input in each text field . Below is a screenshot of the running program.
- download the code: Validate Form Loop Version Starter Code
- If you’re using bluej, you want to run “main” as shown here
- Find the code section shown below. This is the one and only 1 area that you should be editing
- Validate the user input as described below:
- Name
- length of 3 >=
- only letters (spaces is ok)
- Email
- Must include an “@”
- Must include a “.”
- the “.” must come after the “@”
- Phone
- XXX-XXX-XXXX
- where each”X” must be an integer value
- each “-” must be in the correct location
- Date of Birth
- To convert a String to an integer use
Integer.valueOf(String str)
- Max age is 110
- Minimum accepted age is 18
- If the user is less than 18, display the message. “Sorry you must at least 18 years of age for this service”
- Password
- Length must be at least 5
- cannot include the name anywhere inside the password
- Zip Code
- Each character must be an integer
- Length between 3 and 5 , inclusive
If the user has no errors, then please show the message “Thanks for submitting your information ” , as shown below
A file that does a few test cases (be careful not to overwrite your work)