--- old/src/share/classes/sun/awt/SunToolkit.java 2012-09-07 03:19:53.560573700 +0400 +++ new/src/share/classes/sun/awt/SunToolkit.java 2012-09-07 03:19:52.792529800 +0400 @@ -544,7 +544,7 @@ } protected static final Lock flushLock = new ReentrantLock(); - private static boolean isFlushingPendingEvents = false; + private static int flushNestingLevel = 0; /* * Flush any pending events which haven't been posted to the AWT @@ -554,8 +554,8 @@ flushLock.lock(); try { // Don't call flushPendingEvents() recursively - if (!isFlushingPendingEvents) { - isFlushingPendingEvents = true; + ++flushNestingLevel; + if (flushNestingLevel == 1) { AppContext appContext = AppContext.getAppContext(); PostEventQueue postEventQueue = (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY); @@ -564,7 +564,7 @@ } } } finally { - isFlushingPendingEvents = false; + --flushNestingLevel; flushLock.unlock(); } }