What is best way to do event base programing in Java. Is there any tools or API available for the same.
Use interfaces. For example, create an interface IOnMouseDown which has method OnMouseDown() and create an event manager which adds any IOnMouseDown objects to a list of listeners. When the event is triggered, call each one.
Googling "event based programming java" gives you a lot of already-written answers!
I verified.
If you are doing any work with a GUI, you are already using event based programming.
Can you please add more detail to your question, such as what environment and usage you are talking about? As it stands there is not enough context to answer your overly broad question.
Esper is one of the open source alternatives
You mean something like the Event Observer Pattern?
精彩评论