1 /*
2 * Copyright (c) 2013, 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 java.awt.Color;
25 import java.awt.Dialog;
26 import java.awt.Frame;
27 import java.awt.Rectangle;
28 import java.awt.Robot;
29 import java.awt.Toolkit;
30 import java.awt.event.InputEvent;
31
32 import sun.awt.SunToolkit;
33
34 /**
35 * @test
36 * @bug 8008728
37 * @summary [macosx] Swing. JDialog. Modal dialog goes to background
38 * @author Alexandr Scherbatiy
39 * @run main ModalDialogOrderingTest
40 */
41 public class ModalDialogOrderingTest {
42
43 private static final Color DIALOG_COLOR = Color.GREEN;
44 private static final Color FRAME_COLOR = Color.BLUE;
45
46 public static void main(String[] args) {
47
48 final Frame frame = new Frame("Test");
49 frame.setSize(400, 400);
50 frame.setBackground(FRAME_COLOR);
51 frame.setVisible(true);
52
53 final Dialog modalDialog = new Dialog(null, true);
54 modalDialog.setTitle("Modal Dialog");
55 modalDialog.setSize(400, 200);
|
1 /*
2 * Copyright (c) 2013, 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 java.awt.Color;
25 import java.awt.Dialog;
26 import java.awt.Frame;
27 import java.awt.Rectangle;
28 import java.awt.Robot;
29 import java.awt.Toolkit;
30 import java.awt.event.InputEvent;
31
32 import sun.awt.SunToolkit;
33
34 /**
35 * @test
36 * @key headful
37 * @bug 8008728
38 * @summary [macosx] Swing. JDialog. Modal dialog goes to background
39 * @author Alexandr Scherbatiy
40 * @run main ModalDialogOrderingTest
41 */
42 public class ModalDialogOrderingTest {
43
44 private static final Color DIALOG_COLOR = Color.GREEN;
45 private static final Color FRAME_COLOR = Color.BLUE;
46
47 public static void main(String[] args) {
48
49 final Frame frame = new Frame("Test");
50 frame.setSize(400, 400);
51 frame.setBackground(FRAME_COLOR);
52 frame.setVisible(true);
53
54 final Dialog modalDialog = new Dialog(null, true);
55 modalDialog.setTitle("Modal Dialog");
56 modalDialog.setSize(400, 200);
|