当前位置: 技术问答>java相关
简单问题:请问AWT中的windows这个类里面的pack()方法的作用是什么?
来源: 互联网 发布时间:2015-05-30
本文导语: 英文文档里面的解释是: Causes this Window to be sized to fit the preferred size and layouts of its subcomponents. If the window and/or its owner are not yet displayable, both are made displayable before calculating the preferred size. The...
英文文档里面的解释是:
Causes this Window to be sized to fit the preferred size and layouts of its subcomponents. If the window and/or its owner are not yet displayable, both are made displayable before calculating the preferred size. The Window will be validated after the preferredSize is calculated.
但是看得有点不明白,谁能给讲解一下?谢谢。
Causes this Window to be sized to fit the preferred size and layouts of its subcomponents. If the window and/or its owner are not yet displayable, both are made displayable before calculating the preferred size. The Window will be validated after the preferredSize is calculated.
但是看得有点不明白,谁能给讲解一下?谢谢。
|
根据窗口内部组件的preferred size和layout重新设置窗口的大小,使其刚好能够容下内部的所有组件。