test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java

Print this page

        

@@ -25,14 +25,17 @@
   @test
   @bug       7154072 7161320
   @summary   Tests that key events with modifiers are not swallowed.
   @author    anton.tarasov: area=awt.focus
   @library   ../../../regtesthelpers
+  @library ../../../../../lib/testlibrary
+  @build jdk.testlibrary.OSInfo
   @build     Util
   @run       main SwallowKeyEvents
 */
 
+import jdk.testlibrary.OSInfo;
 import java.awt.AWTException;
 import java.awt.Frame;
 import java.awt.Robot;
 import java.awt.TextField;
 import java.awt.event.KeyAdapter;

@@ -47,11 +50,11 @@
     static Frame f = new Frame("Frame");
     static TextField t = new TextField("text");
     static Robot r;
 
     public static void main(String[] args) {
-        if (sun.awt.OSInfo.getOSType() == sun.awt.OSInfo.OSType.WINDOWS) {
+        if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS) {
             System.out.println("Skipped. Test not for MS Windows.");
             return;
         }
 
         f.add(t);