|
|
|
|
|
|
FormElementPrerequisites
All input elements of the RegistrationForm applet have some common behavior. In this Exercise, you will create an abstract class that defines this common behavior and handles events to manage input element validation. FormElement is the superclass of all elements:
Each element knows how to answer isEmpty, getContents, and verify. The phone number and email address of your applet should be verified for correctness--the method verify should be called for each element, defaulting to an empty method if verification makes no sense for that element. Verification is to occur when the user leaves the element by clicking outside that element. To achieve this, you will have to define handleEvent so that it catches Event.LOST_FOCUS and Event.ACTION_EVENT (in case they press Return in a TextField, for example). See PhoneTextField and EMailTextField for more on verifying these fields.
Perform the following tasks:
Required byRelated Exercises
|