--- old/src/share/classes/java/awt/EventQueue.java 2012-08-17 13:46:15.613791500 +0400 +++ new/src/share/classes/java/awt/EventQueue.java 2012-08-17 13:46:14.417723100 +0400 @@ -1039,6 +1039,7 @@ * to its queue, so the EventQueue.dispatchThread reference must * be valid at that point. */ + SunToolkit.flushPendingEvents(); pushPopLock.lock(); try { if (edt == dispatchThread) { @@ -1049,7 +1050,7 @@ * Fix for 4648733. Check both the associated java event * queue and the PostEventQueue. */ - if (!forceDetach && (peekEvent() != null) || !SunToolkit.isPostEventQueueEmpty()) { + if (!forceDetach && (peekEvent() != null)) { return false; } dispatchThread = null;