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.Choice;
25 import java.awt.FlowLayout;
26 import java.awt.Frame;
27 import java.awt.GraphicsConfiguration;
28 import java.awt.GraphicsDevice;
29 import java.awt.GraphicsEnvironment;
30 import java.awt.Insets;
31 import java.awt.Point;
32 import java.awt.Rectangle;
33 import java.awt.Robot;
34 import java.awt.Toolkit;
35 import java.awt.event.InputEvent;
36
37 /**
38 * @test
39 * @bug 8176448
40 * @run main/timeout=300 ChoicePopupLocation
41 */
42 public final class ChoicePopupLocation {
43
44 private static final int SIZE = 350;
45 private static int frameWidth;
46
47 public static void main(final String[] args) throws Exception {
48 GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
49 GraphicsDevice[] sds = ge.getScreenDevices();
50 Point left = null;
51 Point right = null;
52 for (GraphicsDevice sd : sds) {
53 GraphicsConfiguration gc = sd.getDefaultConfiguration();
54 Rectangle bounds = gc.getBounds();
55 if (left == null || left.x > bounds.x) {
56 left = new Point(bounds.x, bounds.y + bounds.height / 2);
57 }
58 if (right == null || right.x < bounds.x + bounds.width) {
|
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.Choice;
25 import java.awt.FlowLayout;
26 import java.awt.Frame;
27 import java.awt.GraphicsConfiguration;
28 import java.awt.GraphicsDevice;
29 import java.awt.GraphicsEnvironment;
30 import java.awt.Insets;
31 import java.awt.Point;
32 import java.awt.Rectangle;
33 import java.awt.Robot;
34 import java.awt.Toolkit;
35 import java.awt.event.InputEvent;
36
37 /**
38 * @test
39 * @key headful
40 * @bug 8176448
41 * @run main/timeout=300 ChoicePopupLocation
42 */
43 public final class ChoicePopupLocation {
44
45 private static final int SIZE = 350;
46 private static int frameWidth;
47
48 public static void main(final String[] args) throws Exception {
49 GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
50 GraphicsDevice[] sds = ge.getScreenDevices();
51 Point left = null;
52 Point right = null;
53 for (GraphicsDevice sd : sds) {
54 GraphicsConfiguration gc = sd.getDefaultConfiguration();
55 Rectangle bounds = gc.getBounds();
56 if (left == null || left.x > bounds.x) {
57 left = new Point(bounds.x, bounds.y + bounds.height / 2);
58 }
59 if (right == null || right.x < bounds.x + bounds.width) {
|