• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

event order guarantee?

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jim, that's exactly what I wanted to know.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic