src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java

Print this page

        

@@ -670,23 +670,28 @@
     public void setResizable(boolean resizable) {
         setStyleBits(RESIZABLE, resizable);
 
         // Re-apply the size constraints and the size to ensure the space
         // occupied by the grow box is counted properly
-        setMinimumSize(1, 1); // the method ignores its arguments
+        peer.updateMinimumSize();
 
         Rectangle bounds = peer.getBounds();
         setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
     }
 
     @Override
-    public void setMinimumSize(int width, int height) {
-        //TODO width, height should be used
-        //NOTE: setResizable() calls setMinimumSize(1,1) relaying on the logic below
+    public void setSizeConstraints(int minW, int minH, int maxW, int maxH) {
         final long nsWindowPtr = getNSWindowPtr();
+        
         final Dimension min = target.getMinimumSize();
+        min.width = Math.max(min.width, minW);
+        min.height = Math.max(min.height, minH);
+
         final Dimension max = target.getMaximumSize();
+        max.width = Math.min(max.width, maxW);
+        max.height = Math.min(max.height, maxH);
+
         nativeSetNSWindowMinMax(nsWindowPtr, min.getWidth(), min.getHeight(), max.getWidth(), max.getHeight());
     }
 
     @Override
     public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) {