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 */
28 import java.awt.Point;
29 import java.awt.Robot;
30 import java.awt.event.ActionEvent;
31 import java.awt.event.ActionListener;
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 puts heavyweight and lightweight components into different
44 * panels and test if splitter image and components itself are drawn correctly.
45 * <p>See base class for test info.
46 */
47 /*
48 @test
49 @bug 6986109
50 @summary Overlapping test for javax.swing.JSplitPane
51 @author sergey.grinev@oracle.com: area=awt.mixing
52 @library ../../regtesthelpers
53 @modules java.desktop/sun.awt
54 java.desktop/java.awt.peer
55 @build Util
56 @run main JSplitPaneOverlapping
57 */
58 public class JSplitPaneOverlapping extends OverlappingTestBase {
59
60 private boolean clicked = false;
61 private Point splitterLoc;
62 private JScrollPane sp1;
63 private JScrollPane sp2;
64
65 protected void prepareControls() {
66 JFrame frame = new JFrame("SplitPane Mixing");
67 JPanel p = new JPanel(new GridLayout());
68 p.setPreferredSize(new Dimension(500, 500));
69 propagateAWTControls(p);
70 sp1 = new JScrollPane(p);
71
72 JButton button = new JButton("JButton");
73 button.setBackground(Color.RED);
74 button.addActionListener(new ActionListener() {
75
76 public void actionPerformed(ActionEvent e) {
|
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 */
28 import java.awt.Point;
29 import java.awt.Robot;
30 import java.awt.event.ActionEvent;
31 import java.awt.event.ActionListener;
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 puts heavyweight and lightweight components into different
44 * panels and test if splitter image and components itself are drawn correctly.
45 * <p>See base class for test info.
46 */
47 /*
48 * @test
49 * @key headful
50 * @bug 6986109
51 * @summary Overlapping test for javax.swing.JSplitPane
52 * @author sergey.grinev@oracle.com: area=awt.mixing
53 * @library ../../regtesthelpers
54 * @modules java.desktop/sun.awt
55 * java.desktop/java.awt.peer
56 * @build Util
57 * @run main JSplitPaneOverlapping
58 */
59 public class JSplitPaneOverlapping extends OverlappingTestBase {
60
61 private boolean clicked = false;
62 private Point splitterLoc;
63 private JScrollPane sp1;
64 private JScrollPane sp2;
65
66 protected void prepareControls() {
67 JFrame frame = new JFrame("SplitPane Mixing");
68 JPanel p = new JPanel(new GridLayout());
69 p.setPreferredSize(new Dimension(500, 500));
70 propagateAWTControls(p);
71 sp1 = new JScrollPane(p);
72
73 JButton button = new JButton("JButton");
74 button.setBackground(Color.RED);
75 button.addActionListener(new ActionListener() {
76
77 public void actionPerformed(ActionEvent e) {
|