a NullPointerException is thrown if you try to reference an instance
of any class where the reference is still null.
Would you please explain in a bit more detail what you mean by the
Button and the TextField? Without more info we can't give more than
general hints about your possible problems.