< prev index next >
test/jdk/javax/swing/JPopupMenu/4634626/bug4634626.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2003, 2016, 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.
--- 1,7 ----
/*
! * 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,44 ****
/*
* @test
* @key headful
* @bug 4634626
* @summary Implement context popup menus for components
- * @author Alexander Zuev
* @library /lib/client
* @build ExtendedRobot
! * @run applet bug4634626.html
*/
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
! public class bug4634626 extends JApplet {
public boolean passed = true;
public boolean done = false;
public JFrame mainFrame = new JFrame("Bug4634626");
--- 24,43 ----
/*
* @test
* @key headful
* @bug 4634626
* @summary Implement context popup menus for components
* @library /lib/client
* @build ExtendedRobot
! * @run main bug4634626
*/
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
! public class bug4634626 {
public boolean passed = true;
public boolean done = false;
public JFrame mainFrame = new JFrame("Bug4634626");
*** 82,91 ****
--- 81,96 ----
}
}
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,125 ****
--- 121,131 ----
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 >