Skip to content

Commit cc7cf81

Browse files
mkartashevAnton Tarasov
authored and
Anton Tarasov
committedFeb 21, 2022
8280861: Robot color picker broken on Linux with scaling above 100%
Reviewed-by: serb
1 parent d7a706a commit cc7cf81

12 files changed

+213
-67
lines changed
 

‎src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -334,7 +334,7 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
334334
if (useGtk) {
335335
gtk->gdk_threads_enter();
336336
gtk_failed = gtk->get_drawable_data(env, pixelArray, x, y, width,
337-
height, jwidth, dx, dy, 1);
337+
height, jwidth, dx, dy);
338338
gtk->gdk_threads_leave();
339339
}
340340

‎src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -2471,27 +2471,14 @@ static jobject gtk2_get_setting(JNIEnv *env, Setting property)
24712471
}
24722472

24732473
static gboolean gtk2_get_drawable_data(JNIEnv *env, jintArray pixelArray, jint x,
2474-
jint y, jint width, jint height, jint jwidth, int dx, int dy, jint scale) {
2474+
jint y, jint width, jint height, jint jwidth, int dx, int dy) {
24752475
GdkPixbuf *pixbuf;
24762476
jint *ary;
24772477

24782478
GdkWindow *root = (*fp_gdk_get_default_root_window)();
24792479

24802480
pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(NULL, root, NULL, x, y,
24812481
0, 0, width, height);
2482-
if (pixbuf && scale != 1) {
2483-
GdkPixbuf *scaledPixbuf;
2484-
x /= scale;
2485-
y /= scale;
2486-
width /= scale;
2487-
height /= scale;
2488-
dx /= scale;
2489-
dy /= scale;
2490-
scaledPixbuf = (*fp_gdk_pixbuf_scale_simple)(pixbuf, width, height,
2491-
GDK_INTERP_BILINEAR);
2492-
(*fp_g_object_unref)(pixbuf);
2493-
pixbuf = scaledPixbuf;
2494-
}
24952482

24962483
if (pixbuf) {
24972484
int nchan = (*fp_gdk_pixbuf_get_n_channels)(pixbuf);

‎src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c

+35-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,9 @@
3737
#include "sizecalc.h"
3838
#include <jni_util.h>
3939
#include <stdio.h>
40+
#include <math.h>
4041
#include "awt.h"
42+
#include "debug_assert.h"
4143

4244
static void *gtk3_libhandle = NULL;
4345
static void *gthread_libhandle = NULL;
@@ -2861,35 +2863,48 @@ static void transform_detail_string (const gchar *detail,
28612863
}
28622864
}
28632865

2866+
inline static int scale_down_ceiling(int what, int scale) {
2867+
return (int)ceilf(what / (float)scale);
2868+
}
2869+
2870+
inline static int scale_down_floor(int what, int scale) {
2871+
return (int)floorf(what / (float)scale);
2872+
}
2873+
28642874
static gboolean gtk3_get_drawable_data(JNIEnv *env, jintArray pixelArray,
2865-
int x, jint y, jint width, jint height, jint jwidth, int dx, int dy,
2866-
jint scale) {
2875+
int x, jint y, jint width, jint height, jint jwidth, int dx, int dy) {
28672876
GdkPixbuf *pixbuf;
28682877
jint *ary;
28692878

2879+
int skip_left = 0;
2880+
int skip_top = 0;
28702881
GdkWindow *root = (*fp_gdk_get_default_root_window)();
28712882
if (gtk3_version_3_10) {
28722883
int win_scale = (*fp_gdk_window_get_scale_factor)(root);
2884+
2885+
// Scale the coordinate and size carefully such that the captured area
2886+
// is at least as large as requested. We trim off excess later by
2887+
// using the skip_* variables.
2888+
const int x_scaled = scale_down_floor(x, win_scale);
2889+
const int y_scaled = scale_down_floor(y, win_scale);
2890+
skip_left = x - x_scaled*win_scale;
2891+
skip_top = y - y_scaled*win_scale;
2892+
DASSERT(skip_left >= 0 && skip_top >= 0);
2893+
2894+
const int x_right_scaled = scale_down_ceiling(x + width, win_scale);
2895+
const int width_scaled = x_right_scaled - x_scaled;
2896+
DASSERT(width_scaled > 0);
2897+
2898+
const int y_bottom_scaled = scale_down_ceiling(y + height, win_scale);
2899+
const int height_scaled = y_bottom_scaled - y_scaled;
2900+
DASSERT(height_scaled > 0);
2901+
28732902
pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(
2874-
root, x, y, (int) (width / (float) win_scale + 0.5), (int) (height / (float) win_scale + 0.5));
2903+
root, x_scaled, y_scaled, width_scaled, height_scaled);
28752904
} else {
28762905
pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(root, x, y, width, height);
28772906
}
28782907

2879-
if (pixbuf && scale != 1) {
2880-
GdkPixbuf *scaledPixbuf;
2881-
x /= scale;
2882-
y /= scale;
2883-
width /= scale;
2884-
height /= scale;
2885-
dx /= scale;
2886-
dy /= scale;
2887-
scaledPixbuf = (*fp_gdk_pixbuf_scale_simple)(pixbuf, width, height,
2888-
GDK_INTERP_BILINEAR);
2889-
(*fp_g_object_unref)(pixbuf);
2890-
pixbuf = scaledPixbuf;
2891-
}
2892-
28932908
if (pixbuf) {
28942909
int nchan = (*fp_gdk_pixbuf_get_n_channels)(pixbuf);
28952910
int stride = (*fp_gdk_pixbuf_get_rowstride)(pixbuf);
@@ -2906,7 +2921,8 @@ static gboolean gtk3_get_drawable_data(JNIEnv *env, jintArray pixelArray,
29062921
int index;
29072922
for (_y = 0; _y < height; _y++) {
29082923
for (_x = 0; _x < width; _x++) {
2909-
p = pix + (intptr_t) _y * stride + _x * nchan;
2924+
p = pix + (intptr_t) (_y + skip_top) * stride
2925+
+ (_x + skip_left) * nchan;
29102926

29112927
index = (_y + dy) * jwidth + (_x + dx);
29122928
ary[index] = 0xff000000

‎src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ typedef struct GtkApi {
510510
guint32 timestamp, GError **error);
511511
gboolean (*get_drawable_data)(JNIEnv *env, jintArray pixelArray,
512512
jint x, jint y, jint width, jint height,
513-
jint jwidth, int dx, int dy, jint scale);
513+
jint jwidth, int dx, int dy);
514514
void (*g_free)(gpointer mem);
515515

516516

‎test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java

+50-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,20 +27,26 @@
2727
import java.awt.Frame;
2828
import java.awt.Graphics;
2929
import java.awt.Panel;
30+
import java.awt.Point;
3031
import java.awt.Rectangle;
3132
import java.awt.Robot;
3233
import java.awt.image.BufferedImage;
3334
import javax.swing.UIManager;
35+
import javax.imageio.ImageIO;
36+
import java.io.File;
37+
import java.io.IOException;
3438

3539
/**
3640
* @test
3741
* @key headful
38-
* @bug 8073320
39-
* @summary Windows HiDPI support
42+
* @bug 8073320 8280861
43+
* @summary Linux and Windows HiDPI support
4044
* @author Alexander Scherbatiy
4145
* @requires (os.family == "linux" | os.family == "windows")
4246
* @run main/othervm -Dsun.java2d.win.uiScaleX=3 -Dsun.java2d.win.uiScaleY=2
4347
* HiDPIRobotScreenCaptureTest
48+
* @run main/othervm -Dsun.java2d.uiScale=1 HiDPIRobotScreenCaptureTest
49+
* @run main/othervm -Dsun.java2d.uiScale=2 HiDPIRobotScreenCaptureTest
4450
*/
4551

4652
public class HiDPIRobotScreenCaptureTest {
@@ -60,7 +66,14 @@ public static void main(String[] args) throws Exception {
6066
}
6167

6268
Frame frame = new Frame();
63-
frame.setBounds(40, 30, 400, 300);
69+
// Position the frame on prime number coordinates to avoid
70+
// them being multiple of the desktop scale; this tests Linux
71+
// color picker better.
72+
// Also, the position should be far enough from the top left
73+
// corner of the screen to reduce the chance of being repositioned
74+
// by the system because that area's occupied by the global
75+
// menu bar and such.
76+
frame.setBounds(83, 97, 400, 300);
6477
frame.setUndecorated(true);
6578

6679
Panel panel = new Panel(new BorderLayout());
@@ -86,11 +99,12 @@ public void paint(Graphics g) {
8699
frame.setVisible(true);
87100
Robot robot = new Robot();
88101
robot.waitForIdle();
89-
Thread.sleep(200);
102+
robot.delay(500);
90103

91104
Rectangle rect = canvas.getBounds();
92105
rect.setLocation(canvas.getLocationOnScreen());
93106

107+
System.out.println("Creating screen capture of " + rect);
94108
BufferedImage image = robot.createScreenCapture(rect);
95109
frame.dispose();
96110

@@ -101,20 +115,38 @@ public void paint(Graphics g) {
101115
throw new RuntimeException("Wrong image size!");
102116
}
103117

104-
if (image.getRGB(w / 4, h / 4) != COLORS[0].getRGB()) {
105-
throw new RuntimeException("Wrong image color!");
106-
}
107-
108-
if (image.getRGB(3 * w / 4, h / 4) != COLORS[1].getRGB()) {
109-
throw new RuntimeException("Wrong image color!");
110-
}
118+
checkRectColor(image, new Rectangle(0, 0, w / 2, h / 2), COLORS[0]);
119+
checkRectColor(image, new Rectangle(w / 2, 0, w / 2, h / 2), COLORS[1]);
120+
checkRectColor(image, new Rectangle(0, h / 2, w / 2, h / 2), COLORS[2]);
121+
checkRectColor(image, new Rectangle(w / 2, h / 2, w / 2, h / 2), COLORS[3]);
122+
}
111123

112-
if (image.getRGB(w / 4, 3 * h / 4) != COLORS[2].getRGB()) {
113-
throw new RuntimeException("Wrong image color!");
114-
}
124+
private static final int OFFSET = 5;
125+
static void checkRectColor(BufferedImage image, Rectangle rect, Color expectedColor) {
126+
System.out.println("Checking rectangle " + rect + " to have color " + expectedColor);
127+
final Point[] pointsToCheck = new Point[] {
128+
new Point(rect.x + OFFSET, rect.y + OFFSET), // top left corner
129+
new Point(rect.x + rect.width - OFFSET, rect.y + OFFSET), // top right corner
130+
new Point(rect.x + rect.width / 2, rect.y + rect.height / 2), // center
131+
new Point(rect.x + OFFSET, rect.y + rect.height - OFFSET), // bottom left corner
132+
new Point(rect.x + rect.width - OFFSET, rect.y + rect.height - OFFSET) // bottom right corner
133+
};
115134

116-
if (image.getRGB(3 * w / 4, 3 * h / 4) != COLORS[3].getRGB()) {
117-
throw new RuntimeException("Wrong image color!");
135+
for (final var point : pointsToCheck) {
136+
System.out.print("Checking color at " + point + " to be equal to " + expectedColor);
137+
final int actualColor = image.getRGB(point.x, point.y);
138+
if (actualColor != expectedColor.getRGB()) {
139+
System.out.println("... Mismatch: found " + new Color(actualColor) + " instead. Check image.png.");
140+
try {
141+
ImageIO.write(image, "png", new File("image.png"));
142+
} catch(IOException e) {
143+
System.out.println("failed to save image.png.");
144+
e.printStackTrace();
145+
}
146+
throw new RuntimeException("Wrong image color!");
147+
} else {
148+
System.out.println("... OK");
149+
}
118150
}
119151
}
120-
}
152+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/*
2+
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2022, JetBrains s.r.o.. All rights reserved.
4+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
*
6+
* This code is free software; you can redistribute it and/or modify it
7+
* under the terms of the GNU General Public License version 2 only, as
8+
* published by the Free Software Foundation.
9+
*
10+
* This code is distributed in the hope that it will be useful, but WITHOUT
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
* version 2 for more details (a copy is included in the LICENSE file that
14+
* accompanied this code).
15+
*
16+
* You should have received a copy of the GNU General Public License version
17+
* 2 along with this work; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*
20+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21+
* or visit www.oracle.com if you need additional information or have any
22+
* questions.
23+
*/
24+
25+
import java.awt.BorderLayout;
26+
import java.awt.Canvas;
27+
import java.awt.Color;
28+
import java.awt.Frame;
29+
import java.awt.Graphics;
30+
import java.awt.Panel;
31+
import java.awt.Point;
32+
import java.awt.Rectangle;
33+
import java.awt.Robot;
34+
35+
/**
36+
* @test
37+
* @key headful
38+
* @bug 8280861
39+
* @summary Verifies Robot screen capture capabilities with different
40+
* Gtk backends and presence of UI scaling
41+
* @requires os.family == "linux"
42+
* @run main/othervm -Djdk.gtk.version=2 -Dsun.java2d.uiScale=1 ScreenCaptureGtkTest
43+
* @run main/othervm -Djdk.gtk.version=2 -Dsun.java2d.uiScale=2 ScreenCaptureGtkTest
44+
* @run main/othervm -Djdk.gtk.version=2 -Dsun.java2d.uiScale=3 ScreenCaptureGtkTest
45+
* @run main/othervm -Djdk.gtk.version=3 -Dsun.java2d.uiScale=1 ScreenCaptureGtkTest
46+
* @run main/othervm -Djdk.gtk.version=3 -Dsun.java2d.uiScale=2 ScreenCaptureGtkTest
47+
* @run main/othervm -Djdk.gtk.version=3 -Dsun.java2d.uiScale=3 ScreenCaptureGtkTest
48+
*/
49+
50+
public class ScreenCaptureGtkTest {
51+
private static final Color[] COLORS = {
52+
Color.GREEN, Color.BLUE, Color.ORANGE, Color.RED};
53+
54+
public static void main(String[] args) throws Exception {
55+
Frame frame = new Frame();
56+
// Position the frame on prime number coordinates to avoid
57+
// them being multiple of the desktop scale; this tests Linux
58+
// color picker better.
59+
// Also, the position should be far enough from the top left
60+
// corner of the screen to reduce the chance of being repositioned
61+
// by the system because that area's occupied by the global
62+
// menu bar and such.
63+
frame.setBounds(83, 97, 400, 300);
64+
frame.setUndecorated(true);
65+
66+
Panel panel = new Panel(new BorderLayout());
67+
Canvas canvas = new Canvas() {
68+
@Override
69+
public void paint(Graphics g) {
70+
super.paint(g);
71+
int w = getWidth();
72+
int h = getHeight();
73+
g.setColor(COLORS[0]);
74+
g.fillRect(0, 0, w, h);
75+
// Paint several distinct pixels next to one another
76+
// in order to test color picker's precision.
77+
for (int i = 1; i < 4; i++) {
78+
g.setColor(COLORS[i]);
79+
g.fillRect(i, 0, 1, 1);
80+
}
81+
}
82+
};
83+
84+
panel.add(canvas);
85+
frame.add(panel);
86+
frame.setVisible(true);
87+
Robot robot = new Robot();
88+
robot.waitForIdle();
89+
robot.delay(500);
90+
91+
final Point screenLocation = frame.getLocationOnScreen();
92+
checkPixelColors(robot, screenLocation.x, screenLocation.y);
93+
94+
robot.delay(100);
95+
frame.dispose();
96+
}
97+
98+
static void checkPixelColors(Robot robot, int x, int y) {
99+
for (int i = 0; i < 4; i++) {
100+
final Color actualColor = robot.getPixelColor(x + i, y);
101+
System.out.print("Checking color at " + (x + i) + ", " + y + " to be equal to " + COLORS[i]);
102+
if (!actualColor.equals(COLORS[i])) {
103+
System.out.println("... Mismatch: found " + actualColor + " instead");
104+
throw new RuntimeException("Wrong screen pixel color");
105+
106+
} else {
107+
System.out.println("... OK");
108+
}
109+
}
110+
}
111+
}

‎test/jdk/javax/swing/JPasswordField/TestSelectedTextBackgroundColor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@ public void run() {
103103
panel.add(passwordField, BorderLayout.CENTER);
104104
frame = new JFrame("TestSelectedTextBackgroundColor");
105105
frame.add(panel);
106-
frame.setSize(200, 200);
106+
frame.setSize(400, 400);
107107
frame.setAlwaysOnTop(true);
108108
frame.setLocationRelativeTo(null);
109109
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

‎test/jdk/javax/swing/JProgressBar/TestJProgressBarHighlightColor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@ public void run() {
103103
panel.add(progressBar, BorderLayout.CENTER);
104104
frame = new JFrame("TestSelectedTextBackgroundColor");
105105
frame.add(panel);
106-
frame.setSize(200, 200);
106+
frame.setSize(400, 400);
107107
frame.setAlwaysOnTop(true);
108108
frame.setLocationRelativeTo(null);
109109
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

‎test/jdk/javax/swing/JSlider/TestJSliderRendering.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ public void run() {
101101
panel.add(slider);
102102
frame = new JFrame("TestJSliderRendering");
103103
frame.add(panel);
104-
frame.setSize(200, 200);
104+
frame.setSize(400, 400);
105105
frame.setAlwaysOnTop(true);
106106
frame.setLocationRelativeTo(null);
107107
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

‎test/jdk/javax/swing/JSpinner/TestSelectedTextBackgroundColor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -119,7 +119,7 @@ public void run() {
119119
panel.add(listModelSpinner, BorderLayout.CENTER);
120120
frame = new JFrame("TestSelectedTextBackgroundColor");
121121
frame.add(panel);
122-
frame.setSize(200, 200);
122+
frame.setSize(400, 400);
123123
frame.setAlwaysOnTop(true);
124124
frame.setLocationRelativeTo(null);
125125
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

‎test/jdk/javax/swing/JTextPane/TestJTextPaneBackgroundColor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@ public void run() {
9696
panel.add(textPane, BorderLayout.CENTER);
9797
frame = new JFrame("TestJTextPaneBackgroundColor");
9898
frame.add(panel);
99-
frame.setSize(200, 200);
99+
frame.setSize(400, 400);
100100
frame.setAlwaysOnTop(true);
101101
frame.setLocationRelativeTo(null);
102102
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

‎test/jdk/javax/swing/JToolTip/TestTooltipBackgroundColor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -134,7 +134,7 @@ public Point getToolTipLocation(MouseEvent event) {
134134
panel.add(label, BorderLayout.CENTER);
135135
frame = new JFrame("TestTooltipBackgroundColor");
136136
frame.add(panel);
137-
frame.setSize(200, 200);
137+
frame.setSize(400, 400);
138138
frame.setAlwaysOnTop(true);
139139
frame.setLocationRelativeTo(null);
140140
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

0 commit comments

Comments
 (0)
Please sign in to comment.