answersLogoWhite

0


Best Answer

1.Implement the Listener interface and overrides its methods

2.Register the component with the Listener

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are two basic steps for event handling in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Definition of event handling in java?

When an application or a program keeps on monitoring and quickly responds to any action that occurs at the GUI interface ,like mouse movement, selecting an item in a list or entering a keyboard input and so on then such a scenario is termed as event handling. In java the events from the event sources are captured and they are sent to event listeners for respective actions to be taken.


What is the purpose of NoMatchException handling method in java?

java exception


Why is event handling in java not working in Linux?

It is working, so you may have made an error, or your JRE/JDK version is too old, or whatever else.


What is difference between exception handling in C and Java?

Easy: there is no exception-handling in C.


What are listeners and how it is used in event handling?

Listeners are java classes which extend EventListener. Event handling is a process of notifying listeners of an event. For example if you click a button, the AWT thread will process the click and the button will notify any of it's relevant listeners of the event that just occurred, calling all the added ActionListeners actionPerformed functions. When events happen the system doesn't know who to tell about the actions. Telling everybody would be a waste. So listeners are required to be registered to the various Swing and AWT classes, as well as any custom listeners you may want to write, so as to know who should be told when something happens. Which is how the listener paradigm works thus implementing event handling (at least in Java).

Related questions

What are the advantages and disadvantages event handler to event properties?

what are the advantages and dis advantages of event handling in java


What are the features of core java?

Core java refers to the core or basic concepts of the Java programming language. Things like encapsulation, inheritance, multi-threading, exception handling and other basic feature of java that comes as part of the Java standard edition forms Core Java


What is the definition of Core Java?

Core java refers to the core or basic concepts of the Java programming language. Things like encapsulation, inheritance, multi-threading, exception handling and other basic feature of java that comes as part of the Java standard edition forms Core Java


What are the features of the core?

Core java refers to the core or basic concepts of the Java programming language. Things like encapsulation, inheritance, multi-threading, exception handling and other basic feature of java that comes as part of the Java standard edition forms Core Java


Definition of event handling in java?

When an application or a program keeps on monitoring and quickly responds to any action that occurs at the GUI interface ,like mouse movement, selecting an item in a list or entering a keyboard input and so on then such a scenario is termed as event handling. In java the events from the event sources are captured and they are sent to event listeners for respective actions to be taken.


What is the purpose of NoMatchException handling method in java?

java exception


Why is event handling in java not working in Linux?

It is working, so you may have made an error, or your JRE/JDK version is too old, or whatever else.


What is difference between exception handling in C and Java?

Easy: there is no exception-handling in C.


Which is the base class of exception handling in java?

Thorwable


What are listeners and how it is used in event handling?

Listeners are java classes which extend EventListener. Event handling is a process of notifying listeners of an event. For example if you click a button, the AWT thread will process the click and the button will notify any of it's relevant listeners of the event that just occurred, calling all the added ActionListeners actionPerformed functions. When events happen the system doesn't know who to tell about the actions. Telling everybody would be a waste. So listeners are required to be registered to the various Swing and AWT classes, as well as any custom listeners you may want to write, so as to know who should be told when something happens. Which is how the listener paradigm works thus implementing event handling (at least in Java).


When should we use exception handling in java?

Exception handling should be used in Java in all cases where you as a programmer suspect that your code might throw some exceptions or create errors that might look ugly when a user is using the application. In such cases you use exception handling to catch and handle the exception and exit gracefully. You use the try - catch block in Java for exception handling.


Can you install java application on nokia n95?

Most mobile devices do not have the capability of handling the Java program.