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.BorderLayout;
25 import java.awt.Canvas;
26 import java.awt.Color;
27 import java.awt.Frame;
28 import java.awt.Graphics;
29 import java.awt.Panel;
30 import java.awt.Rectangle;
31 import java.awt.Robot;
32 import java.awt.image.BufferedImage;
33 import javax.swing.UIManager;
34
35 /* @test
36 * @bug 8073320
37 * @summary Windows HiDPI support
38 * @author Alexander Scherbatiy
39 * @requires (os.family == "windows")
40 * @run main/othervm -Dsun.java2d.win.uiScaleX=3 -Dsun.java2d.win.uiScaleY=2
41 * HiDPIRobotScreenCaptureTest
42 */
43 public class HiDPIRobotScreenCaptureTest {
44
45 private static final Color[] COLORS = {
46 Color.GREEN, Color.BLUE, Color.ORANGE, Color.RED};
47
48 public static void main(String[] args) throws Exception {
49
50 try {
51 UIManager.setLookAndFeel(
52 "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
53 } catch (Exception e) {
54 return;
55 }
56
57 Frame frame = new Frame();
58 frame.setBounds(40, 30, 400, 300);
59 frame.setUndecorated(true);
60
61 Panel panel = new Panel(new BorderLayout());
62 Canvas canvas = new Canvas() {
|
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.BorderLayout;
25 import java.awt.Canvas;
26 import java.awt.Color;
27 import java.awt.Frame;
28 import java.awt.Graphics;
29 import java.awt.Panel;
30 import java.awt.Rectangle;
31 import java.awt.Robot;
32 import java.awt.image.BufferedImage;
33 import javax.swing.UIManager;
34
35 /**
36 * @test
37 * @key headful
38 * @bug 8073320
39 * @summary Windows HiDPI support
40 * @author Alexander Scherbatiy
41 * @requires (os.family == "windows")
42 * @run main/othervm -Dsun.java2d.win.uiScaleX=3 -Dsun.java2d.win.uiScaleY=2
43 * HiDPIRobotScreenCaptureTest
44 */
45
46 public class HiDPIRobotScreenCaptureTest {
47
48 private static final Color[] COLORS = {
49 Color.GREEN, Color.BLUE, Color.ORANGE, Color.RED};
50
51 public static void main(String[] args) throws Exception {
52
53 try {
54 UIManager.setLookAndFeel(
55 "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
56 } catch (Exception e) {
57 return;
58 }
59
60 Frame frame = new Frame();
61 frame.setBounds(40, 30, 400, 300);
62 frame.setUndecorated(true);
63
64 Panel panel = new Panel(new BorderLayout());
65 Canvas canvas = new Canvas() {
|