I have 2 classes: class1, class2. In class2 I have a textfield. In class1 I am trying to set the textfield in class2 with text: class2.textField_name.setText(string). This does not work - null pointer exception???
Are you trying to set the text before the TextField has been instantiated ?
Or before class2 itself has been instantiated ?
Try checking the sequence of events.
If none of the above, check the string has been initialized (give it a dummy value if necessary).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.