here are my classes
public class PersonView extends Composite{
    private Person person;
    @UiField
    FirstnameView firstnameView;
    @UiField
    LastnameView lastnameView;
    public PersonView(Person person) {
        setData(person);
    }
    public void setData(Person person) {
        firstnameView.setData(person.getFirstname());
        lastnameView.setData(person.getLastname());
    }
}
public class FirstnameView extends Composite{
        private Firstname firstname;
        @UiField
        TextBox firstnameTextBox;
        public FirstnameView() {
        }
        public void setData(Firstname firstname) {
            firstnameTextBox.setValue(firstname.getFirstname());
        }
    }
public class LastnameView extends Composite{
        private Lastname lastname;
        @UiField
        TextBox lastnameTextBox;
        public LastnameView() {
        }
        public void setData(Lastname lastname) {
            lastnameTextBox.setValue(lastname.getLastname());
        }
    }
My problem is that when I call method setData(person), I get the following error
java.lang.NullPointerException: null in the line `firstnameView.setData(person.getFirstname())`
I think that @UiField FirstnameView firstnameView (and the lastnameView too) doesn't create an object. I really don't understand how gwt works in this case. Help me please resolve it and set data.
                        
@UiFields are only "injected" when you callinitAndBindUion aUiBinderinstance, passing an instance with the@UiFields as argument.In other words, your
PersonViewconstructor should begin with initializing aUiBinderinstance and callingbinder.initAndBindUi(this)before you can callsetData().