--- old/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java 2016-01-13 16:22:15.197465000 +0530 +++ new/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java 2016-01-13 16:22:15.021465000 +0530 @@ -141,5 +141,31 @@ xLocation += xOffset; } } + + @Override + public Dimension minimumLayoutSize(Container c) { + if (c != null) { + Component[] children = c.getComponents(); + if (children != null && children.length > 0) { + int numChildren = children.length; + Insets cInsets = c.getInsets(); + int extraHeight = cInsets.top + cInsets.bottom; + int extraWidth = cInsets.left + cInsets.right; + + Dimension maxSize = new Dimension(kOKCancelButtonWidth, + kButtonHeight); + for (int i = 0; i < numChildren; i++) { + Dimension sizes = children[i].getPreferredSize(); + maxSize.width = Math.max(maxSize.width, sizes.width); + maxSize.height = Math.max(maxSize.height, sizes.height); + } + return new Dimension(extraWidth + + (maxSize.width * numChildren) + + (numChildren - 1) * padding, + extraHeight + maxSize.height); + } + } + return new Dimension(0, 0); + } } }