< prev index next >
test/jdk/java/awt/Window/LocationAtScreenCorner/LocationAtScreenCorner.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 19,47 ****
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
/**
* @test
* @key headful
! * @bug 8201364
* @summary Component.getLocation() should returns correct location if
* Component.setBounds() was ignored by the OS
*/
public final class LocationAtScreenCorner {
public static void main(final String[] args) throws Exception {
Robot robot = new Robot();
Frame frame = new Frame();
frame.setSize(200, 200);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
robot.waitForIdle();
--- 19,54 ----
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+ import java.awt.AWTException;
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
/**
* @test
* @key headful
! * @bug 8201364 8232433
* @summary Component.getLocation() should returns correct location if
* Component.setBounds() was ignored by the OS
*/
public final class LocationAtScreenCorner {
public static void main(final String[] args) throws Exception {
+ test(true);
+ test(false);
+ }
+
+ private static void test(final boolean undecorated) throws AWTException {
Robot robot = new Robot();
Frame frame = new Frame();
+ frame.setUndecorated(undecorated);
frame.setSize(200, 200);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
robot.waitForIdle();
< prev index next >