How can a gui component handle its own events?
Answer / Roopali Sharma
In Core Java, a GUI component can handle its own events by implementing the ActionListener or other event-specific interfaces such as ItemListener, AdjustmentListener, etc. Then, it overrides the respective method(s) like actionPerformed() for ActionEvent or itemStateChanged() for ItemEvent. Upon an event occurrence, the component will call the appropriate method in the registered listener object.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is vector?
What is the difference between the >> and >>> operators?
How does synchronized modifier work?
What are the different ways of implementing thread? Which one is more advantageous?
Why javac is not recognized?
What is the structure of java?
What is double parsedouble in java?
When do we use hashset over treeset?
How do you delete a list in java?
Name few java 8 annotations ?
Which containers use a flowlayout as their default layout in java programming?
Can I extend singleton class in java?