changeset 4094:1be42326f1c2

7039403: Could not compile test/javax/swing/JLabel/6596966/bug6596966.java Reviewed-by: malenkov
author rupashka
date Wed, 27 Apr 2011 13:43:22 +0400
parents 78890acd99e4
children 0896c9712cf0
files test/javax/swing/JLabel/6596966/bug6596966.java
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/swing/JLabel/6596966/bug6596966.java	Tue Apr 26 10:46:19 2011 +0900
+++ b/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() {