From aa161ffe8d9b643893b13bed12468f399f71e66d Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Wed, 27 Apr 2011 13:43:22 +0400 Subject: [PATCH] 7039403: Could not compile test/javax/swing/JLabel/6596966/bug6596966.java Reviewed-by: malenkov --- jdk/test/javax/swing/JLabel/6596966/bug6596966.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jdk/test/javax/swing/JLabel/6596966/bug6596966.java b/jdk/test/javax/swing/JLabel/6596966/bug6596966.java index 5cf0110f700..5e94459bcb7 100644 --- a/jdk/test/javax/swing/JLabel/6596966/bug6596966.java +++ b/jdk/test/javax/swing/JLabel/6596966/bug6596966.java @@ -24,13 +24,13 @@ /* @test @bug 6596966 @summary Some JFileChooser mnemonics do not work with sticky keys - * @library ../../regtesthelpers - * @build Util @run main bug6596966 @author Pavel Porvatov */ +import sun.awt.SunToolkit; + import javax.swing.*; import java.awt.*; import java.awt.event.KeyEvent; @@ -44,6 +44,7 @@ public class bug6596966 { public static void main(String[] args) throws Exception { Robot robot = new Robot(); + SunToolkit toolkit = (SunToolkit) SunToolkit.getDefaultToolkit(); SwingUtilities.invokeAndWait(new Runnable() { public void run() { @@ -68,17 +69,17 @@ public class bug6596966 { } }); - Util.blockTillDisplayed(frame); + toolkit.realSync(); robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_L); - robot.waitForIdle(); + toolkit.realSync(); - Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED, + toolkit.getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED, EventQueue.getMostRecentEventTime(), 0, KeyEvent.VK_L, 'L')); - robot.waitForIdle(); + toolkit.realSync(); try { SwingUtilities.invokeAndWait(new Runnable() {