diff -r 087eca2f351b -r e0d32945f6ab jdk/src/share/classes/java/awt/Dialog.java --- a/jdk/src/share/classes/java/awt/Dialog.java Fri May 04 21:25:08 2012 +0400 +++ b/jdk/src/share/classes/java/awt/Dialog.java Thu May 10 20:05:12 2012 +0400 @@ -1037,7 +1037,7 @@ predictedFocusOwner = getMostRecentFocusOwner(); if (conditionalShow(predictedFocusOwner, time)) { modalFilter = ModalEventFilter.createFilterForDialog(this); - Conditional cond = new Conditional() { + final Conditional cond = new Conditional() { @Override public boolean evaluate() { return windowClosingException == null; @@ -1067,7 +1067,12 @@ modalityPushed(); try { - EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue(); + final EventQueue eventQueue = AccessController.doPrivileged( + new PrivilegedAction() { + public EventQueue run() { + return Toolkit.getDefaultToolkit().getSystemEventQueue(); + } + }); secondaryLoop = eventQueue.createSecondaryLoop(cond, modalFilter, 0); if (!secondaryLoop.enter()) { secondaryLoop = null;