Creating a LabelField
is just as simple as creating a SeparatorField
except that the label text is also needed. So, add the following code to the createFields
method and run the application to see the label.
add(new LabelField("Label Field")); // A separator field between each type of control add(new SeparatorField());
At this point, we can see the LabelField
that we just added on the screen under the SeparatorField
that we saw last time and followed by another SeparatorField
. Each time we add a new field to the screen we will continue to follow this pattern so that each field is separated out, making it easier to see each field as we add them. Also, notice that we still can't scroll the cursor around because none of the fields on the screen can receive focus.