Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SETTING TEXTFIELD IN ANOTHER CLASS

Status
Not open for further replies.

eh171

Programmer
Feb 21, 2003
9
GB
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).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top