Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InvokeLater ordering with events

The EventQueue javadoc states that it is required that enqueued events are dispatched sequentially and in order.

Is it correct that Runnables enqueued with EventQueue.invokeLater are guaranteed to be dispatched before subsequent user events (e.g. a MouseEvent)? In other words can an event handler be executed before the enqueued Runnable, if the user event happend after EventQueue.invokeLater.

Thanks!

like image 231
user643011 Avatar asked Jan 25 '13 17:01

user643011


1 Answers

The API docs state that events are

In the same order as they are enqueued.

But if you check the source code, you'll see that that isn't always the case although it is largely correct for most purposes.

like image 161
Tom Hawtin - tackline Avatar answered Oct 02 '22 11:10

Tom Hawtin - tackline