1 /*
2 * Copyright (c) 2014, 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
25 import java.awt.*;
26 import java.awt.event.InputEvent;
27 import javax.swing.*;
28 import java.io.*;
29 import test.java.awt.regtesthelpers.Util;
30
31 /**
32 * AWT/Swing overlapping test for Panel and JPanel behavior during resizing.
33 * <p>See <a href="https://bugs.openjdk.java.net/browse/JDK-6786219">JDK-6786219</a> for details
34 */
35 /*
36 @test
37 @bug 6786219
38 @summary Issues when resizing the frame after mixing of heavy weight & light weight components
39 @author sergey.grinev@oracle.com: area=awt.mixing
40 @library ../../regtesthelpers
41 @build Util
42 @build FrameBorderCounter
43 @run main MixingPanelsResizing
44 */
45 public class MixingPanelsResizing {
46
47 static volatile boolean failed = false;
48
49 private static JFrame frame;
50 private static JButton jbutton;
51 private static Button awtButton;
52 private static JButton jbutton2;
53 private static Button awtButton2;
54 private static final Color jbColor = Color.RED;
55 private static final Color awtColor = Color.ORANGE;
56 private static final Color jb2Color = Color.BLUE;
57 private static final Color awt2Color = Color.CYAN;
58 private static final int ROBOT_DELAY = 500;
59
60 private static Point lLoc;
61 private static int borderShift;
62
63 private static int frameBorderCounter() {
|
1 /*
2 * Copyright (c) 2014, 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
25 import java.awt.*;
26 import java.awt.event.InputEvent;
27 import javax.swing.*;
28 import java.io.*;
29 import test.java.awt.regtesthelpers.Util;
30
31 /**
32 * AWT/Swing overlapping test for Panel and JPanel behavior during resizing.
33 * <p>See <a href="https://bugs.openjdk.java.net/browse/JDK-6786219">JDK-6786219</a> for details
34 */
35 /*
36 * @test
37 * @key headful
38 * @bug 6786219
39 * @summary Issues when resizing the frame after mixing of heavy weight & light weight components
40 * @author sergey.grinev@oracle.com: area=awt.mixing
41 * @library ../../regtesthelpers
42 * @build Util
43 * @build FrameBorderCounter
44 * @run main MixingPanelsResizing
45 */
46 public class MixingPanelsResizing {
47
48 static volatile boolean failed = false;
49
50 private static JFrame frame;
51 private static JButton jbutton;
52 private static Button awtButton;
53 private static JButton jbutton2;
54 private static Button awtButton2;
55 private static final Color jbColor = Color.RED;
56 private static final Color awtColor = Color.ORANGE;
57 private static final Color jb2Color = Color.BLUE;
58 private static final Color awt2Color = Color.CYAN;
59 private static final int ROBOT_DELAY = 500;
60
61 private static Point lLoc;
62 private static int borderShift;
63
64 private static int frameBorderCounter() {
|