1. First, add the following code to the
createFields
method.// A separator field between each type of control add(new SeparatorField()); String initialValue = ""; EditField edit = new EditField("Edit: ",initialValue); edit.setMaxSize(25); add(edit);
2. Run the application and test out the rolling character feature.
Wow, this code sure does look familiar, doesn't it? It should. It's nearly identical to the BasicEditField
example code, well, except for the name. Everything needed to make the rolling character feature work is handled by the framework and those changes don't really affect us as developers. In fact, the only methods the EditField
class adds over the BasicEditField
are used by the class itself and aren't needed by outside developers.
You may have noticed that this time you didn't add any code to the getValue
method. This is because getting the data from an EditField
is exactly the same as getting data from a BasicEditField...