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 import java.awt.Color;
25 import java.awt.Rectangle;
26 import java.awt.Robot;
27 import javax.swing.JFrame;
28 import javax.swing.JPanel;
29 import javax.swing.SwingUtilities;
30
31 /**
32 * @test
33 * @bug 8175301
34 * @summary Java GUI hangs on Windows when Display set to 125%
35 * @run main/othervm -Dsun.java2d.uiScale=2 ScaledFrameBackgroundTest
36 * @run main/othervm -Dsun.java2d.uiScale=2 -Dsun.java2d.d3d=true ScaledFrameBackgroundTest
37 * @run main/othervm -Dsun.java2d.uiScale=2 -Dsun.java2d.opengl=true ScaledFrameBackgroundTest
38 */
39 public class ScaledFrameBackgroundTest {
40
41 private static final Color BACKGROUND = Color.RED;
42 private static JFrame frame;
43
44 public static void main(String[] args) throws Exception {
45
46 Robot robot = new Robot();
47 robot.setAutoDelay(50);
48
49 SwingUtilities.invokeAndWait(() -> {
50 frame = new JFrame();
51 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
52 frame.setSize(400, 300);
|
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 import java.awt.Color;
25 import java.awt.Rectangle;
26 import java.awt.Robot;
27 import javax.swing.JFrame;
28 import javax.swing.JPanel;
29 import javax.swing.SwingUtilities;
30
31 /**
32 * @test
33 * @key headful
34 * @bug 8175301
35 * @summary Java GUI hangs on Windows when Display set to 125%
36 * @run main/othervm -Dsun.java2d.uiScale=2 ScaledFrameBackgroundTest
37 * @run main/othervm -Dsun.java2d.uiScale=2 -Dsun.java2d.d3d=true ScaledFrameBackgroundTest
38 * @run main/othervm -Dsun.java2d.uiScale=2 -Dsun.java2d.opengl=true ScaledFrameBackgroundTest
39 */
40 public class ScaledFrameBackgroundTest {
41
42 private static final Color BACKGROUND = Color.RED;
43 private static JFrame frame;
44
45 public static void main(String[] args) throws Exception {
46
47 Robot robot = new Robot();
48 robot.setAutoDelay(50);
49
50 SwingUtilities.invokeAndWait(() -> {
51 frame = new JFrame();
52 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
53 frame.setSize(400, 300);
|