< prev index next >

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

Print this page

        

@@ -31,10 +31,12 @@
 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,20 +73,20 @@
         window.dispose();
     }
 
     public static void testSize() throws Exception {
         Window window = new Window((Frame) null);
-        window.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
+        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 == Integer.MAX_VALUE ||
-                size.height == Integer.MAX_VALUE) {
+        if (size.width == A_BIG_SIZE ||
+                size.height == A_BIG_SIZE) {
             window.dispose();
             throw new RuntimeException("size is wrong");
         }
 
         window.dispose();
< prev index next >