You may have forgotten to register a listener with the button. Without a listener, the events are ignored.
JTextField is a box that contains text.
The user can type text into the box and the program can get it
and then use it as data.
The program can write the results of a calculation to a
To enter text into the field you must first click the mouse pointer inside of it. This gives the field the keyboard focus (usually just called focus). When a component has the focus characters from the keyboard are directed to that component. A component gets focus by various means. The user might click it, or the program might give it focus.