< prev index next >
test/jdk/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java
Print this page
rev 60071 : 8211999: Window positioning bugs due to overlapping GraphicsDevice bounds (Windows/HiDPI)
Reviewed-by: XXX
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2020, 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.
@@ -22,11 +22,11 @@
*/
/**
* @test
* @key headful
- * @bug 6345003 8171363
+ * @bug 6345003 8171363 8211999
* @summary grab problems with EmbeddedFrame
* @requires (os.family == "windows")
* @modules java.desktop/java.awt.peer
* @modules java.desktop/sun.awt
* @modules java.desktop/sun.awt.windows:open
@@ -65,10 +65,11 @@
}
final Frame frame = new Frame("AWT Frame");
frame.pack();
frame.setSize(200, 200);
+ frame.setLocationRelativeTo(null);
FramePeer frame_peer = AWTAccessor.getComponentAccessor()
.getPeer(frame);
Class comp_peer_class
= Class.forName("sun.awt.windows.WComponentPeer");
Field hwnd_field = comp_peer_class.getDeclaredField("hwnd");
@@ -86,10 +87,11 @@
});
combo.setSelectedIndex(1);
final Panel p = new Panel();
p.setLayout(new BorderLayout());
embedded_frame.add(p, BorderLayout.CENTER);
+ embedded_frame.setBounds(0, 0, 150, 150);
embedded_frame.validate();
p.add(combo);
p.validate();
frame.setVisible(true);
Robot robot = new Robot();
< prev index next >