This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes event order guarantee? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "event order guarantee?" Watch "event order guarantee?" New topic
Author

event order guarantee?

Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Hello,
To continue a topic someone else pondered a couple of days ago...
Is there any guarantee that events will be received by the GUI (event handlers) in the order that they were generated?
Thank You,
-Dirk Schreckmann


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Yes, there is. Otherwise how could you type a series of characters and expect that the keys will be read in the correct order? It would be impossible to write any sort of text editor, for example. Instead, it is guaranteed that a single listener will always observe multiple events in the order they were generated. What is not guaranteed is the order in which multiple listeners will be notified of a single event. So if there are three events with multiple listeners - first all listeners will be notified of event 1 (in unknown order), then all listeners will be notified of event 2 (again in unknown and possibly different order), and then all listeners will be notified of event 3 (etc).


"I'm not back." - Bill Harding, Twister
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Thanks Jim, that's exactly what I wanted to know.
 
jQuery in Action, 2nd edition
 
subject: event order guarantee?
 
Similar Threads
How and What Do I do with the Enumeration Data
Javacap mock test que-27
Hashtable doubt
Listeners execution
OrderBy problem