10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.*;
25 import java.awt.event.*;
26 import javax.swing.*;
27
28 /**
29 * @test
30 * @bug 4670486
31 * @author Mark Davidson
32 * @summary Regression: Popup menu bindings doesn't work when a default button has been defined.
33 * @library ../../regtesthelpers
34 * @build Util
35 * @run main bug4670486
36 */
37 public class bug4670486 {
38
39 public static volatile boolean actionExpected = false;
40 public static volatile boolean actionRecieved = false;
41
42 private static JMenuBar createMenuBar() {
43 JMenuBar menubar = new JMenuBar();
44
45 // Control with unique menu
46 JMenu menu = new JMenu("Unique Menu");
47 menu.setMnemonic('U');
48 menu.add(createMenuItem("Sunday", 'S'));
49 menu.add(createMenuItem("Monday", 'M'));
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.*;
25 import java.awt.event.*;
26 import javax.swing.*;
27
28 /**
29 * @test
30 * @key headful
31 * @bug 4670486
32 * @author Mark Davidson
33 * @summary Regression: Popup menu bindings doesn't work when a default button has been defined.
34 * @library ../../regtesthelpers
35 * @build Util
36 * @run main bug4670486
37 */
38 public class bug4670486 {
39
40 public static volatile boolean actionExpected = false;
41 public static volatile boolean actionRecieved = false;
42
43 private static JMenuBar createMenuBar() {
44 JMenuBar menubar = new JMenuBar();
45
46 // Control with unique menu
47 JMenu menu = new JMenu("Unique Menu");
48 menu.setMnemonic('U');
49 menu.add(createMenuItem("Sunday", 'S'));
50 menu.add(createMenuItem("Monday", 'M'));
|