java.awt

Class Dimension

  • java.lang.Object
    • java.awt.geom.Dimension2D
      • java.awt.Dimension
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    public class Dimension extends java.awt.geom.Dimension2D implements java.io.Serializable
    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.

    Since:
    1.0
    See Also:
    Component, LayoutManager, Serialized Form
    • Fields 
      Modifier and Type Field and Description
      Ordinary member indicator height Reveal DetailHide Detail
      The height dimension; negative values can be used.
      Ordinary member indicator width Reveal DetailHide Detail
      The width dimension; negative values can be used.
    • Constructors 
      Constructor and Description
      Ordinary member indicator Dimension Reveal DetailHide Detail
      Creates an instance of Dimension with a width of zero and a height of zero.
      Ordinary member indicator Dimension Reveal DetailHide Detail
      Creates an instance of Dimension whose width and height are the same as for the specified dimension.
      Ordinary member indicator Dimension Reveal DetailHide Detail
      Constructs a Dimension and initializes it to the specified width and specified height.
    • Methods 
      Modifier and Type Method and Description
      Inherited member indicator clone Reveal DetailHide Detail
      Creates a new object of the same class as this object.
      Overridden member indicator equals Reveal DetailHide Detail
      Checks whether two dimension objects have equal values.
      Overridden member indicator getHeight Reveal DetailHide Detail
      Returns the height of this Dimension in double precision.
      Ordinary member indicator getSize Reveal DetailHide Detail
      Gets the size of this Dimension object.
      Overridden member indicator getWidth Reveal DetailHide Detail
      Returns the width of this Dimension in double precision.
      Overridden member indicator hashCode Reveal DetailHide Detail
      Returns the hash code for this Dimension.
      Ordinary member indicator setSize Reveal DetailHide Detail
      Sets the size of this Dimension object to the specified size.
      Inherited member indicator setSize Reveal DetailHide Detail
      Sets the size of this Dimension2D object to match the specified size.
      Overridden member indicator setSize Reveal DetailHide Detail
      Sets the size of this Dimension object to the specified width and height in double precision.
      Ordinary member indicator setSize Reveal DetailHide Detail
      Sets the size of this Dimension object to the specified width and height.
      Overridden member indicator toString Reveal DetailHide Detail
      Returns a string representation of the values of this Dimension object's height and width fields.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge