1 /*
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 test.java.awt.regtesthelpers.Util;
25
26 import java.awt.AWTException;
27 import java.awt.Button;
28 import java.awt.Frame;
29 import java.awt.Robot;
30 import java.awt.event.ActionEvent;
31 import java.awt.event.ActionListener;
32
33 /*
34 @test
35 @bug 7097771
36 @summary setEnabled does not work for components in disabled containers.
37 @author sergey.bylokhov@oracle.com: area=awt.component
38 @library ../../regtesthelpers
39 @build Util
40 @run main bug7097771
41 */
42 public final class bug7097771 extends Frame implements ActionListener {
43
44 private static volatile boolean action;
45
46 public static void main(final String[] args) throws AWTException {
47 final bug7097771 frame = new bug7097771();
48 frame.setSize(300, 300);
49 frame.setLocationRelativeTo(null);
50 final Button button = new Button();
51 button.addActionListener(frame);
52 frame.add(button);
53 frame.setVisible(true);
54 Robot robot = new Robot();
|
1 /*
2 * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 test.java.awt.regtesthelpers.Util;
25
26 import java.awt.AWTException;
27 import java.awt.Button;
28 import java.awt.Frame;
29 import java.awt.Robot;
30 import java.awt.event.ActionEvent;
31 import java.awt.event.ActionListener;
32
33 /*
34 @test
35 @key headful
36 @bug 7097771
37 @summary setEnabled does not work for components in disabled containers.
38 @author sergey.bylokhov@oracle.com: area=awt.component
39 @library ../../regtesthelpers
40 @build Util
41 @run main bug7097771
42 */
43 public final class bug7097771 extends Frame implements ActionListener {
44
45 private static volatile boolean action;
46
47 public static void main(final String[] args) throws AWTException {
48 final bug7097771 frame = new bug7097771();
49 frame.setSize(300, 300);
50 frame.setLocationRelativeTo(null);
51 final Button button = new Button();
52 button.addActionListener(frame);
53 frame.add(button);
54 frame.setVisible(true);
55 Robot robot = new Robot();
|