1. Add the following code to the createFields method
ActiveAutoTextEditField activeauto = new ActiveAutoTextEditField("ActiveAuto:","Visit Packt Publishing online at www.packtpub.com"); add(activeauto); // A separator field between each type of control add(new SeparatorField());
2. Run the application and test out the active region. Optionally, add your own phone number and e-mail address into the field.
The ActiveAutoTextEditField
is still surprisingly simple to create and use. This example is very similar to the previous examples, the biggest difference here is that a different initial text is supplied to contain a website address that the field will establish as an active region. Other than that, the pattern for creating new fields remains the same and the code to get the text of the field is exactly the same as the fields we've studied previously. Much like the asterisks in the PasswordEditField
, when the getText
...