< prev index next >

test/jdk/java/awt/Component/F10TopToplevel/F10TopToplevel.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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.

@@ -18,55 +18,29 @@
  *
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 /*
-  test
+  @test
+  @key headful
   @bug 6533175
   @summary Block F10 if closest toplevel to keystroke target is not a Frame.
-  @author yuri nesterenko : area=awt.toplevel
-  @run applet F10TopToplevel.html
+  @run main F10TopToplevel
 */
 
-
-
-/**
- * F10TopToplevel.java
- *
- * summary: tests if F10 has no effect if focused toplevel if not Frame
- */
-
-import java.applet.Applet;
 import java.awt.*;
 import java.awt.event.*;
 
+public class F10TopToplevel {
+
+    static Frame frame;
+    static Dialog dialog;
+    static volatile boolean menuToggled = false;
 
-public class F10TopToplevel extends Applet
-{
-    //Declare things used in the test, like buttons and labels here
-    Frame frame;
-    Dialog dialog;
-    volatile boolean menuToggled = false;
-
-    public void init()
-    {
-        setLayout (new BorderLayout ());
-
-    }//End  init()
-
-    public void start ()
-    {
-        //Get things going.  Request focus, set size, et cetera
-        setSize (200,200);
-        setVisible(true);
-        validate();
-
-
-        //What would normally go into main() will probably go here.
-        //Use System.out.println for diagnostic messages that you want
-        //to read after the test is done.
+    public static void main(final String[] args) {
         MenuBar mb;
         Menu menu;
         MenuItem item;
         frame = new Frame("am below");
         frame.setMenuBar( (mb=new MenuBar()) );

@@ -113,8 +87,7 @@
 
         if(menuToggled) {
             throw new RuntimeException("Oops! Menu should not open.");
         }
 
-    }// start()
-
+    }
 }// class F10TopToplevel
< prev index next >