This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Custome events and Listener methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Custome events and Listener methods" Watch "Custome events and Listener methods" New topic
Author

Custome events and Listener methods

john sayeau
Ranch Hand

Joined: Aug 23, 2010
Posts: 33
Hi I've written a collection class that extends arraylist, a custom event the extends eventobject and a custom listener.

I have the customlist.add() trigger a listener method and the customlist.addAll(collection) trigger another listener method.
Both methods work, however, when I run customList.addAll(collection) both listener methods get triggered. the listener method that is triggered with customList.add() gets triggered as many times as there is elements in the collection being added.

Is there a way to stop the listener method triggered by customList.Add() from tirggering when I add a collection to the customlist without writing a second listener?
Is there a way to detect if an object is part of a collection?
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

You didn't post any code so I'm just guessing. Can't you do somelike


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custome events and Listener methods
 
Similar Threads
Listeners in a cluster
It's about JavaBeans
Issue with ComponentListener
HFSJ mock exam doubt
"valueUnbound" behaviour