< prev index next >

test/java/awt/Window/ScreenLocation/ScreenLocationTest.java

Print this page

        

*** 31,40 **** --- 31,42 ---- import java.awt.*; public class ScreenLocationTest { + public static final int A_BIG_SIZE = Integer.MAX_VALUE>>1; + public static void main(String[] args) throws Exception { testLocation(); testSize(); System.out.println("ok"); }
*** 71,90 **** window.dispose(); } public static void testSize() throws Exception { Window window = new Window((Frame) null); ! window.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE); window.setVisible(true); Robot robot = new Robot(); robot.delay(200); robot.waitForIdle(); Dimension size = window.getSize(); ! if (size.width == Integer.MAX_VALUE || ! size.height == Integer.MAX_VALUE) { window.dispose(); throw new RuntimeException("size is wrong"); } window.dispose(); --- 73,92 ---- window.dispose(); } public static void testSize() throws Exception { Window window = new Window((Frame) null); ! window.setSize(A_BIG_SIZE, A_BIG_SIZE); window.setVisible(true); Robot robot = new Robot(); robot.delay(200); robot.waitForIdle(); Dimension size = window.getSize(); ! if (size.width == A_BIG_SIZE || ! size.height == A_BIG_SIZE) { window.dispose(); throw new RuntimeException("size is wrong"); } window.dispose();
< prev index next >