Package java.awt |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
public class java.awt.Dimension extends java.lang.Object { // Fields public int height; public int width; // Constructors public Dimension(); public Dimension(Dimension d); public Dimension(int width, int height); // Methods public String toString(); }
A class that encapsulates the width and height of a component in a single object.
public int heightThe height of the component.
public int widthThe width of the component.
public Dimension()Creates a Dimension with a width of zero and a height of zero.
public Dimension(Dimension d)Creates a Dimension whose width and height are the same as the argument.
Parameter Description d the specified dimension for the width and height values
public Dimension(int width, int height)Creates a Dimension with the specified width and height.
Parameter Description width the width height the height
public String toString()Return Value:
Returns a string representation of this dimension.
Overrides:
toString in class Object .