--- old/test/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 2017-03-16 21:59:57.000000000 +0300 +++ new/test/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 2017-03-16 21:59:56.000000000 +0300 @@ -42,17 +42,23 @@ public final class ChoicePopupLocation { private static final int SIZE = 350; + private static int frameWidth; public static void main(final String[] args) throws Exception { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] sds = ge.getScreenDevices(); Point left = null; + Point right = null; for (GraphicsDevice sd : sds) { GraphicsConfiguration gc = sd.getDefaultConfiguration(); Rectangle bounds = gc.getBounds(); if (left == null || left.x > bounds.x) { left = new Point(bounds.x, bounds.y + bounds.height / 2); } + if (right == null || right.x < bounds.x + bounds.width) { + right = new Point(bounds.x + bounds.width, + bounds.y + bounds.height / 2); + } Point point = new Point(bounds.x, bounds.y); Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc); @@ -69,6 +75,10 @@ left.translate(-50, 0); test(left); } + if (right != null) { + right.translate(-frameWidth + 50, 0); + test(right); + } } private static void test(final Point tmp) throws Exception { @@ -82,7 +92,8 @@ frame.setLayout(new FlowLayout()); frame.add(choice); frame.pack(); - frame.setSize(frame.getWidth(), SIZE); + frameWidth = frame.getWidth(); + frame.setSize(frameWidth, SIZE); frame.setVisible(true); frame.setLocation(tmp.x, tmp.y); openPopup(choice);