< prev index next >

test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.java

Print this page

        

@@ -20,26 +20,26 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
 /*
-  test
+  @test
+  @key headful
   @bug       6396785
   @summary   MenuItem activated with space should swallow this space.
-  @author    anton.tarasov@...: area=awt.focus
-  @run       applet MenuItemActivatedTest.html
+  @library    ../../../regtesthelpers
+  @build      Util
+  @run        main MenuItemActivatedTest
 */
 
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import java.applet.Applet;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.lang.reflect.InvocationTargetException;
 import test.java.awt.regtesthelpers.Util;
 
-public class MenuItemActivatedTest extends Applet {
+public class MenuItemActivatedTest {
     Robot robot;
     JFrame frame = new JFrame("Test Frame");
     JDialog dialog = new JDialog((Window)null, "Test Dialog", Dialog.ModalityType.DOCUMENT_MODAL);
     JTextField text = new JTextField();
     JMenuBar bar = new JMenuBar();

@@ -53,23 +53,19 @@
         app.start();
     }
 
     public void init() {
         robot = Util.createRobot();
-
-        // 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() {
         menu.setMnemonic('f');
         menu.add(item);
         bar.add(menu);
         frame.setJMenuBar(bar);
         frame.pack();
+        frame.setLocationRelativeTo(null);
 
         item.addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent ae) {
                     dialog.add(text);
                     dialog.pack();
< prev index next >