when you compile the thread you have to give it some reference to the class that has txtData, so that the thread can access to it through get method.
From the class that calls the thread you can do that
MyThread myThread = new MyThread(txtData)
and thread class has an attribute to save the reference to txtData