< prev index next >

test/jdk/javax/swing/JPopupMenu/4634626/bug4634626.java

Print this page

        

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

@@ -24,21 +24,20 @@
 /*
  * @test
  * @key headful
  * @bug 4634626
  * @summary Implement context popup menus for components
- * @author Alexander Zuev
  * @library ../../../../lib/testlibrary
  * @build ExtendedRobot
- * @run applet bug4634626.html
+ * @run main bug4634626
  */
 
 import javax.swing.*;
 import java.awt.event.*;
 import java.awt.*;
 
-public class bug4634626 extends JApplet {
+public class bug4634626 {
 
     public boolean passed = true;
     public boolean done = false;
 
     public JFrame mainFrame = new JFrame("Bug4634626");

@@ -82,10 +81,16 @@
         }
     }
 
     public static MouseWatcher mouser = new MouseWatcher();
 
+    public static void main(final String[] args) {
+        bug4634626 app = new bug4634626();
+        app.init();
+        app.destroy();
+    }
+
     public void init() {
 
         try {
             popButton.setComponentPopupMenu(null);
             popButton.setComponentPopupMenu(null);

@@ -116,10 +121,11 @@
 
         mainFrame.pack();
         mainFrame.setLocation(50, 50);
 
         mainFrame.addWindowListener(new TestStateListener());
+        mainFrame.setLocationRelativeTo(null);
         mainFrame.setVisible(true);
 
         while(!done) Thread.yield();
 
         if(!passed) {
< prev index next >