Package java.awt Previous
Previous
Java API
Java API
Index
Index
Next
Next

Class Dimension

Fields , Constructors , Methods

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.


Fields


height

public int height 

The height of the component.


width

public int width 

The width of the component.


Constructors


Dimension

public Dimension() 

Creates a Dimension with a width of zero and a height of zero.


Dimension

public Dimension(Dimension  d) 

Creates a Dimension whose width and height are the same as the argument.

ParameterDescription
d the specified dimension for the width and height values


Dimension

public Dimension(int  width, int  height) 

Creates a Dimension with the specified width and height.

ParameterDescription
width the width
height the height


Methods


toString

public String toString() 

Return Value:

Returns a string representation of this dimension.

Overrides:

toString in class Object .



Top© 1996 Sun Microsystems, Inc. All rights reserved.