Dimension继承自java.awt.geom.Dimension2D,有两个属性height和width,中间封装了可以取得一个矩形的高和宽及面积等的方法。

解决方案 »

  1.   

    The Dimension class encapsulates the width and height of a component (in integer precision) in a single object. The class is associated with certain properties of components. Several methods defined by the Component class and the LayoutManager interface return a Dimension object. Normally the values of width and height are non-negative integers. The constructors that allow you to create a dimension do not prevent you from setting a negative value for these properties. If the value of width or height is negative, the behavior of some methods defined by other objects is undefined.
    基本上 Dimension 代表一块矩形区域
    有 height 和 width 两个属性例子中的代码好像是在设置 Frame 的图标