45.4k views
2 votes
Every event object has the _____ method that can be used to identify the component that triggered the event.

getSource()
getAction()
getTrigger()
getComponent()

1 Answer

4 votes

Answer:

getSource()

Step-by-step explanation:

Every event object has the getSource() method that can be used to identify the component that triggered the event.

For example , if a button is pressed on the user interface, this results in its event handler code getting executed. The event handler takes as parameter an Event object. This event object reference can then be used by the handler code to access the event source reference by calling event.getSource() .

User Pranavk
by
4.4k points