--- old/src/java.desktop/share/classes/javax/swing/JRootPane.java 2017-08-01 14:51:01.836790700 +0530 +++ new/src/java.desktop/share/classes/javax/swing/JRootPane.java 2017-08-01 14:51:00.819839900 +0530 @@ -922,7 +922,7 @@ rd = new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE - i.top - i.bottom - mbd.height - 1); } - return new Dimension(Math.min(rd.width, mbd.width) + i.left + i.right, + return new Dimension(Math.max(rd.width, mbd.width) + i.left + i.right, rd.height + mbd.height + i.top + i.bottom); }