7039403: Could not compile test/javax/swing/JLabel/6596966/bug6596966.java
authorrupashka
Wed, 27 Apr 2011 13:43:22 +0400
changeset 9491 f7970a9d4656
parent 9490 c22b8eb2da0f
child 9492 9dbb46097d62
7039403: Could not compile test/javax/swing/JLabel/6596966/bug6596966.java Reviewed-by: malenkov
jdk/test/javax/swing/JLabel/6596966/bug6596966.java
--- a/jdk/test/javax/swing/JLabel/6596966/bug6596966.java	Tue Apr 26 10:46:19 2011 +0900
+++ b/jdk/test/javax/swing/JLabel/6596966/bug6596966.java	Wed Apr 27 13:43:22 2011 +0400
@@ -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 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 @@
             }
         });
 
-        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() {