可能是因为框架的大小包括边框的大小。
框架是带有标题和边框的顶级窗口。边框的大小包括为边框指定的任何区域。可以使用getInsets方法获得边界区域的尺寸。由于边框区域包括在框架的整体大小中,因此边框有效地遮盖了框架的一部分,从而将可用于渲染和/或显示子组件的区域限制为具有(插入)左上角位置的矩形。左侧为insets.top),尺寸为宽度-(insets.left
+ insets.right)乘以高度-(insets.top + insets.bottom)。
来源:http
:
//download.oracle.com/javase/tutorial/uiswing/components/frame.html



