Professional Documents
Culture Documents
You are to complete the Java program called RegistrationForm. The GUI already has the labels and textfields for name, address, city, state and zip completed.
Once the form has been completed by user, the submit button is pressed. The ActionListener listens to the submit button and when that button is pressed the actionPerformed method is executed. Since there are 2 buttons (submit and clear) on this form, we need to distinguish between the actions that should be taken when the user clicks on the submit button and clicks on the clear button. To do this, we need to check the event that is passed into the actionPerformed method to see if it equals Submit (submit button) or Clear (clear button). If the event is the submit button, then we need to have if statements that one-by-one calls methods that test the accuracy of the data.
The following if statement causes each of the methods to be executed: if (checkName() & checkAddress() & checkCity() & checkState() & checkZip() ) Note: The & is used instead of the && (short-circuit AND) because you want all methods to be executed even if the first method returns false. You should see all the errors at one time. Please see the program for method descriptions. If the event is the clear button, then the text should be cleared from the text boxes and the label foreground colors should be set at black.
You are to do add the following: Add labels and textfields for phone, email, password, and retype password. Adjust the GUI any way that you like as long as it looks good. DO NOT delete the labels and textfields that I have already created for you. (4 points) Adjust the if statement in actionPerformed method to cause execution of the methods: checkPhone, checkEmail and checkPassword. (1 point) The checkPhone method needs to be added to program. This method should test that the user has entered the first 3 digits of the phone as 972 or 214. If the first 3 digits of phone number are 972 or 214, then the phone label foreground should be set to black. If