< prev index next >

test/jdk/java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -20,28 +20,24 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
 /*
-  @test      %W% %E%
+  @test
   @key headful
   @bug       6637607
   @summary   Showing a modal dlg on TAB KEY_PRESS shouldn't consume inappropriate KEY_TYPED.
-  @author    Anton Tarasov: area=awt-focus
   @library   ../../regtesthelpers
   @build     Util
   @run       main ConsumeNextKeyTypedOnModalShowTest
 */
 
 import java.awt.*;
 import java.awt.event.*;
-import java.applet.Applet;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.lang.reflect.InvocationTargetException;
 import test.java.awt.regtesthelpers.Util;
 
-public class ConsumeNextKeyTypedOnModalShowTest extends Applet {
+public class ConsumeNextKeyTypedOnModalShowTest {
     Robot robot;
     Frame frame = new Frame("Frame");
     Dialog dialog = new Dialog(frame, "Dialog", true);
     TextField tf0 = new TextField();
     TextField tf1 = new TextField();

@@ -74,10 +70,11 @@
             }
         }, KeyEvent.KEY_EVENT_MASK);
     }
 
     public void start() {
+        frame.setLocationRelativeTo(null);
         frame.setVisible(true);
         Util.waitTillShown(frame);
 
         // Show the dialog.
         robot.keyPress(KeyEvent.VK_TAB);
< prev index next >