# Class Dimension

java.lang.Object
com.codename1.ui.geom.Dimension

public class Dimension extends java.lang.Object
Utility class that holds a width and height that represents a dimension of a component or element

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Dimension()`
  Creates a new instance of Dimension
  `Dimension(int width, int height)`
  CCreates a new instance of Dimension with width and height
  `Dimension(Dimension d)`
  Creates a new instance of Dimension with a predefine dimension

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(java.lang.Object arg0)`
  `int`
  `getHeight()`
  Return the height of the dimension
  `int`
  `getWidth()`
  Returns the width of the dimension
  `int`
  `hashCode()`
  `void`
  `setHeight(int height)`
  Set the height of the dimension
  `void`
  `setWidth(int width)`
  Set the width of the dimension
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Dimension

    public Dimension()
    Creates a new instance of Dimension

  - ### Dimension

    public Dimension(Dimension d)

    Creates a new instance of Dimension with a predefine dimension

    ###### Parameters

    - `d`: Dimension to copy

  - ### Dimension

    public Dimension(int width, int height)

    CCreates a new instance of Dimension with width and height

    ###### Parameters

    - `width`: the dimention width

    - `height`: the dimention height

- ## Method Details

  - ### getWidth

    public int getWidth()

    Returns the width of the dimension

    ###### Returns

    width of the dimension

  - ### setWidth

    public void setWidth(int width)

    Set the width of the dimension

    ###### Parameters

    - `width`: the dimention width

  - ### getHeight

    public int getHeight()

    Return the height of the dimension

    ###### Returns

    height of the dimension

  - ### setHeight

    public void setHeight(int height)

    Set the height of the dimension

    ###### Parameters

    - `height`: the dimention height

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `java.lang.Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `java.lang.Object`

  - ### equals

    public boolean equals(java.lang.Object arg0)
    Overrides:
      `equals` in class `java.lang.Object`