Answer:
With some programming effort, it would work. The listener would have to check that both text fields had valid data before doing anything. This might be awkward.
Do it! Button
Both values are needed before the application code can be started. You could write the event listener to check that there is data in both fields before it calls the application method. However, let us take a different approach. The user enters data into the text fields and then clicks to perform the calculation.
Action events from the text fields are ignored. The listener receives only events from the button.
QUESTION 12:
Which of the components needs to register a listener?