• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Custom Event and Listener Declaration ???

Is there a good tutorial somewhere on how to create custom events and listeners?  I realize I'll be using EventObject, and EventListener, but I'm looking for a good, working example.

I've reviewed the short tutorial at http://javaalmanac.com/egs/java.util/CustEvent.html and found it somewhat lacking.  Thanks in advance for you help.
0
west17m
Asked:
west17m
  • 2
  • 2
1 Solution
 
CEHJCommented:
In what respects is it lacking - maybe we can help?
0
 
west17mAuthor Commented:
The tutorial that the above site does the job, but it is in three classes (Event, Listener, Other).  I'm looking for something concise that will end up being similar to implement like ActionListener with the ActionPerformed method.
0
 
CEHJCommented:
It can't get any more concise as far as i can see. The reason it's less concise than simply receiving events through actionPerformed is that you have to

a. Create your own event instead of just listen for it
b. Create a list of listeners instead of merely add to an existing one
0
 
west17mAuthor Commented:
I just got done writing a blackjack program that was based on custom events and listeners.  The files are short and sweet and simply allow objects to communicate through a function fireMyEvent(obj,obj,String) that sends from one obj to another some String that's a message.

Shoot me an email at travis@wsor.net, and I'll send you the source if you want.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now