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 */
32 import java.awt.event.InputEvent;
33 import javax.swing.JButton;
34 import javax.swing.JFrame;
35 import javax.swing.JPanel;
36 import javax.swing.JScrollPane;
37 import javax.swing.JSplitPane;
38 import javax.swing.SwingUtilities;
39 import test.java.awt.regtesthelpers.Util;
40
41 /**
42 * AWT/Swing overlapping test for {@link javax.swing.JSplitPane } component.
43 * <p>This test creates puts heavyweight and lightweight components into different panels and test if splitter image and components itself are drawn correctly.
44 * <p>See base class for test info.
45 */
46 /*
47 @test
48 @bug 6986109
49 @summary Overlapping test for javax.swing.JSplitPane
50 @author sergey.grinev@oracle.com: area=awt.mixing
51 @library ../../regtesthelpers
52 @build Util
53 @run main JSplitPaneOverlapping
54 */
55 public class JSplitPaneOverlapping extends OverlappingTestBase {
56
57 private boolean clicked = false;
58 private Point splitterLoc;
59 private JScrollPane sp1;
60 private JScrollPane sp2;
61
62 protected void prepareControls() {
63 JFrame frame = new JFrame("SplitPane Mixing");
64 JPanel p = new JPanel(new GridLayout());
65 p.setPreferredSize(new Dimension(500, 500));
66 propagateAWTControls(p);
67 sp1 = new JScrollPane(p);
68
69 JButton button = new JButton("JButton");
70 button.setBackground(Color.RED);
71 button.addActionListener(new ActionListener() {
|
1 /*
2 * Copyright (c) 2014, 2015, 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 */
32 import java.awt.event.InputEvent;
33 import javax.swing.JButton;
34 import javax.swing.JFrame;
35 import javax.swing.JPanel;
36 import javax.swing.JScrollPane;
37 import javax.swing.JSplitPane;
38 import javax.swing.SwingUtilities;
39 import test.java.awt.regtesthelpers.Util;
40
41 /**
42 * AWT/Swing overlapping test for {@link javax.swing.JSplitPane } component.
43 * <p>This test creates puts heavyweight and lightweight components into different panels and test if splitter image and components itself are drawn correctly.
44 * <p>See base class for test info.
45 */
46 /*
47 @test
48 @bug 6986109
49 @summary Overlapping test for javax.swing.JSplitPane
50 @author sergey.grinev@oracle.com: area=awt.mixing
51 @library ../../regtesthelpers
52 @modules java.desktop/java.awt.peer
53 java.desktop/sun.awt
54 @build Util
55 @run main JSplitPaneOverlapping
56 */
57 public class JSplitPaneOverlapping extends OverlappingTestBase {
58
59 private boolean clicked = false;
60 private Point splitterLoc;
61 private JScrollPane sp1;
62 private JScrollPane sp2;
63
64 protected void prepareControls() {
65 JFrame frame = new JFrame("SplitPane Mixing");
66 JPanel p = new JPanel(new GridLayout());
67 p.setPreferredSize(new Dimension(500, 500));
68 propagateAWTControls(p);
69 sp1 = new JScrollPane(p);
70
71 JButton button = new JButton("JButton");
72 button.setBackground(Color.RED);
73 button.addActionListener(new ActionListener() {
|