• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Listeners

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
a) If multiple listeners are added to a component, the order of invokation is specified to be the order in which they were added.
this is false, isn't it?
one mock exam i did, it said true, but other exam said it was false.
Can someone help me out?
Thanks in advance..
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sean,
You are right. As per the event delegation model which is used in Java 2 ,all listeners of a particular event are notified but the order in which they are notified may/may not be the same as the order in which they were added.

Hope it helps,
Ira

------------------
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The RHE book says
there is no guarantee that the listeners will be notified in the order in which they were added.
So I think that the answer should be false
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will say that it is exact that you cannot garantee the order in wich listener will be called but
If you subclass a component (like Button) and in the constructor of the class that you are building you call the enableEvents method + you override the processActionEvent method of the component. The processActionEvent method that you provided will be called before any listener of this component.
Hope this help.

[This message has been edited by Claude Rouleau (edited October 25, 2000).]
 
sean cee
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys..
That clarify the doubt...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic