TheDimensionclass encapsulates the width andheight of a component (in integer precision) in a single object.The class isassociated with certain properties of components. Several methodsdefined by theComponentclass and theLayoutManagerinterface return aDimensionobject.
Normally the values ofwidthandheightare non-negative integers.The constructors that allow you to create a dimension donot prevent you from setting a negative value for these properties.If the value ofwidthorheightisnegative, the behavior of some methods defined by other objects isundefined.
Sets the size of thisDimensionobject tothe specified width and height in double precision.Note that ifwidthorheightare larger thanInteger.MAX_VALUE, they willbe reset toInteger.MAX_VALUE.
Sets the size of thisDimensionobjectto the specified width and height.This method is included for completeness, to parallel thesetSizemethod defined byComponent.
Returns a string representation of the values of thisDimensionobject'sheightandwidthfields. This method is intended to be used onlyfor debugging purposes, and the content and format of the returnedstring may vary between implementations. The returned string may beempty but may not benull.