"but if I write something to the text box nothing is updating in the class property."
You're probably going to want to implement a DocumentListener
to listen for changes in the underlying document of the text field. Every time the document changes, for instance the typing in of a letter, a DocumentEvent
will be fired. You can see How to Write a DocumentListener