All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.Dimension
java.lang.Object
|
+----java.awt.Dimension
- public class Dimension
- extends Object
- implements Serializable
A class to encapsulate a width and a height Dimension.
-
height
- The height dimension.
-
width
- The width dimension.
-
Dimension()
-
Constructs a Dimension object with 0 width and 0 height.
-
Dimension(Dimension)
-
Constructs a Dimension and initializes it to the specified value.
-
Dimension(int, int)
-
Constructs a Dimension and initializes it to the specified width and
specified height.
-
equals(Object)
- Checks whether two dimension objects have equal values.
-
getSize()
- Returns the size of this Dimension object.
-
setSize(Dimension)
- Set the size of this Dimension object to match the specified size.
-
setSize(int, int)
- Set the size of this Dimension object to the specified width
and height.
-
toString()
- Returns the String representation of this Dimension's values.
width
public int width
- The width dimension.
height
public int height
- The height dimension.
Dimension
public Dimension()
- Constructs a Dimension object with 0 width and 0 height.
Dimension
public Dimension(Dimension d)
- Constructs a Dimension and initializes it to the specified value.
- Parameters:
- d - the specified dimension for the width and height values
Dimension
public Dimension(int width,
int height)
- Constructs a Dimension and initializes it to the specified width and
specified height.
- Parameters:
- width - the specified width dimension
- height - the specified height dimension
getSize
public Dimension getSize()
- Returns the size of this Dimension object.
This method is included for completeness, to parallel the
getSize method of Component.
setSize
public void setSize(Dimension d)
- Set the size of this Dimension object to match the specified size.
This method is included for completeness, to parallel the
getSize method of Component.
- Parameters:
- d - the new size for the Dimension object
setSize
public void setSize(int width,
int height)
- Set the size of this Dimension object to the specified width
and height.
This method is included for completeness, to parallel the
getSize method of Component.
- Parameters:
- width - the new width for the Dimension object
- height - the new height for the Dimension object
equals
public boolean equals(Object obj)
- Checks whether two dimension objects have equal values.
- Overrides:
- equals in class Object
toString
public String toString()
- Returns the String representation of this Dimension's values.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index