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 sun.awt.SunToolkit;
25 import test.java.awt.regtesthelpers.Util;
26
27 import java.awt.AWTException;
28 import java.awt.Button;
29 import java.awt.Frame;
30 import java.awt.Robot;
31 import java.awt.Toolkit;
32 import java.awt.event.ActionEvent;
33 import java.awt.event.ActionListener;
34
35 /*
36 @test
37 @bug 7097771
38 @summary setEnabled does not work for components in disabled containers.
39 @author sergey.bylokhov@oracle.com: area=awt.component
40 @library ../../regtesthelpers
41 @build Util
42 @run main bug7097771
43 */
44 public final class bug7097771 extends Frame implements ActionListener {
45
46 private static volatile boolean action;
47
48 public static void main(final String[] args) throws AWTException {
49 final bug7097771 frame = new bug7097771();
50 frame.setSize(300, 300);
51 frame.setLocationRelativeTo(null);
52 final Button button = new Button();
53 button.addActionListener(frame);
54 frame.add(button);
55 frame.setVisible(true);
56 sleep();
|
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 sun.awt.SunToolkit;
25 import test.java.awt.regtesthelpers.Util;
26
27 import java.awt.AWTException;
28 import java.awt.Button;
29 import java.awt.Frame;
30 import java.awt.Robot;
31 import java.awt.Toolkit;
32 import java.awt.event.ActionEvent;
33 import java.awt.event.ActionListener;
34
35 /*
36 @test
37 @key headful
38 @bug 7097771
39 @summary setEnabled does not work for components in disabled containers.
40 @author sergey.bylokhov@oracle.com: area=awt.component
41 @library ../../regtesthelpers
42 @build Util
43 @run main bug7097771
44 */
45 public final class bug7097771 extends Frame implements ActionListener {
46
47 private static volatile boolean action;
48
49 public static void main(final String[] args) throws AWTException {
50 final bug7097771 frame = new bug7097771();
51 frame.setSize(300, 300);
52 frame.setLocationRelativeTo(null);
53 final Button button = new Button();
54 button.addActionListener(frame);
55 frame.add(button);
56 frame.setVisible(true);
57 sleep();
|