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.BorderLayout;
25 import java.awt.Component;
26 import java.awt.Dimension;
27 import java.awt.Point;
28 import java.awt.Robot;
29 import java.awt.event.InputEvent;
30 import javax.swing.JFrame;
31 import javax.swing.JPanel;
32 import javax.swing.JTextArea;
33 import javax.swing.SwingUtilities;
34
35 /**
36 * @test
37 * @bug 8149849
38 * @summary [hidpi] DnD issues (cannot DnD from JFileChooser to JEditorPane or
39 * other text component) when scale > 1
40 * @run main/othervm -Dsun.java2d.uiScale=2 DNDTextToScaledArea
41 */
42 public class DNDTextToScaledArea {
43
44 private static final String TEXT = "ABCDEFGH";
45 private static JFrame frame;
46 private static JTextArea srcTextArea;
47 private static JTextArea dstTextArea;
48 private static volatile Point srcPoint;
49 private static volatile Point dstPoint;
50 private static volatile boolean passed = false;
51
52 public static void main(String[] args) throws Exception {
53 Robot robot = new Robot();
54 robot.setAutoDelay(50);
55
56 SwingUtilities.invokeAndWait(DNDTextToScaledArea::createAndShowGUI);
|
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.BorderLayout;
25 import java.awt.Component;
26 import java.awt.Dimension;
27 import java.awt.Point;
28 import java.awt.Robot;
29 import java.awt.event.InputEvent;
30 import javax.swing.JFrame;
31 import javax.swing.JPanel;
32 import javax.swing.JTextArea;
33 import javax.swing.SwingUtilities;
34
35 /**
36 * @test
37 * @key headful
38 * @bug 8149849
39 * @summary [hidpi] DnD issues (cannot DnD from JFileChooser to JEditorPane or
40 * other text component) when scale > 1
41 * @run main/othervm -Dsun.java2d.uiScale=2 DNDTextToScaledArea
42 */
43 public class DNDTextToScaledArea {
44
45 private static final String TEXT = "ABCDEFGH";
46 private static JFrame frame;
47 private static JTextArea srcTextArea;
48 private static JTextArea dstTextArea;
49 private static volatile Point srcPoint;
50 private static volatile Point dstPoint;
51 private static volatile boolean passed = false;
52
53 public static void main(String[] args) throws Exception {
54 Robot robot = new Robot();
55 robot.setAutoDelay(50);
56
57 SwingUtilities.invokeAndWait(DNDTextToScaledArea::createAndShowGUI);
|