< prev index next >

test/jdk/java/awt/Focus/WindowInitialFocusTest/WindowInitialFocusTest.java

Print this page

        

@@ -20,43 +20,36 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
 /*
-  test
+  @test
+  @key headful
   @bug       6426132
-  @summary   A Window should be initially focused on its showing (XAWT bug).
-  @author    anton.tarasov@...: area=awt.focus
-  @run       applet WindowInitialFocusTest.html
+  @summary    A Window should be focused upon start (XAWT bug).
+  @library    ../../regtesthelpers
+  @build      Util
+  @run        main WindowInitialFocusTest
 */
 
 import java.awt.*;
 import java.awt.event.*;
-import java.applet.Applet;
 import java.util.concurrent.atomic.AtomicBoolean;
 import test.java.awt.regtesthelpers.Util;
 
-public class WindowInitialFocusTest extends Applet {
+public class WindowInitialFocusTest {
     Frame frame = new Frame("Test Frame");
     Window window = new Window(frame);
     Button button = new Button("button");
     AtomicBoolean focused = new AtomicBoolean(false);
     Robot robot;
 
     public static void main(String[] args) {
         WindowInitialFocusTest app = new WindowInitialFocusTest();
-        app.init();
         app.start();
     }
 
-    public void init() {
-        // Create instructions for the user here, as well as set up
-        // the environment -- set the layout manager, add buttons,
-        // etc.
-        this.setLayout (new BorderLayout ());
-    }
-
     public void start() {
         frame.setBounds(800, 0, 200, 100);
         window.setBounds(800, 200, 200, 100);
         window.setLayout(new FlowLayout());
         window.add(button);
< prev index next >