Here's what happens:
1. "A" key is pressed on the button.
KEY_PRESSED event is posted (natively originated) with some t0 time.
KEY_TYPED event is posted (synthesized) with some t1 time.
2. KEY_PRESSED is dispatched to the button, action binding is resolved, focus is requested to the textfield.
The focus request is marked with a time stamp corresponding to the most-recent-event-time
(most recently dispatched event) which is t0. A type-ahead-marker (t0) is created & pushed.
3. KEY_TYPED is being dispatched. In case t1 > t0, the event is queued until the textfield gains focus
and after that is eventually dispatched to the textfield. In case t1 == t0, the event is dispatched
to the button (expected behaviour).
So, the problem is that t1 and t0 times may differ. However, KEY_PRESSED & KEY_TYPED java events are
actually a production of a single native key down event. So, t1 must equal t0. That's what we have in
X11 code, where KEY_TYPED is also synthesized (not natively originated).