i want to assign a label to the TextField. I am using the following code
TextField textField = new TextField();
Label label = new Label("Pick a unique username");
textField.setLabelForComponent(label);
textField.setConstraint(TextField.ANY);
form.addComponent(textField);
form.show();
the above code is not showing the associated label for the TextField. How can it be done ?
An excerpt of the
Componentfrom the LWUIT javadoc @ linkHence your are just associating a
Labelwith thisComponentand now actual binding them together as perceived / visually single group..
I would recommend you use
ComponentGroupwithTextFieldandLabeladded to it, also you can style them as a group. Check this link for more information onComponentGroupPS:
ComponentGroupis available from LWUIT 1.5.