Dimension
class encapsulates the width and height of a component (in int precision) in a single object. Component
class and the LayoutManager
interface return a Dimension
object. Normally the values of width
and height
are non-negative ints. 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.