--- old/src/java.desktop/share/classes/java/awt/EventQueue.java 2015-07-01 15:57:37.577712900 +0300 +++ new/src/java.desktop/share/classes/java/awt/EventQueue.java 2015-07-01 15:57:37.131156200 +0300 @@ -899,11 +899,13 @@ } } - // Wake up EDT waiting in getNextEvent(), so it can - // pick up a new EventQueue. Post the waking event before - // topQueue.nextQueue is assigned, otherwise the event would - // go newEventQueue - topQueue.postEventPrivate(new InvocationEvent(topQueue, dummyRunnable)); + if (topQueue.dispatchThread != null) { + // Wake up EDT waiting in getNextEvent(), so it can + // pick up a new EventQueue. Post the waking event before + // topQueue.nextQueue is assigned, otherwise the event would + // go newEventQueue + topQueue.postEventPrivate(new InvocationEvent(topQueue, dummyRunnable)); + } newEventQueue.previousQueue = topQueue; topQueue.nextQueue = newEventQueue;