Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
3rd Edition
ISBN: 9780134038179
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 15.6, Problem 15.19CP

Explanation of Solution

Identifying the button that called the handler:

If the program contains two different buttons on one event handler, the method that is used to identify which button called the handler is getTarget().

  • The “getTarget()” method is present “ActionEvent” class that returns the EventTarget type...

Blurred answer
Students have asked these similar questions
At runtime, the visibility of controls is decided by their characteristics in the same way that other controls are.
In the same way as with other controls, a control's attribute decides whether or not it appears on the form during runtime?
What is the event for moving the mouse while pressing the right mouse button?

Chapter 15 Solutions

Starting Out with Java: From Control Structures through Data Structures (3rd Edition)

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
CMPTR
Computer Science
ISBN:9781337681872
Author:PINARD
Publisher:Cengage