Packages  This Package  Prev  Next  Index  

§1.13 Class Dimension

public  class  java.awt.Dimension
    extends  java.lang.Object  (I-§1.12)
{
        // Fields
    public int height;	§1.13.1
    public int width;	§1.13.2

        // Constructors
    public Dimension();	§1.13.3
    public Dimension(Dimension  d);	§1.13.4
    public Dimension(int  width, int  height);	§1.13.5

        // Methods
    public String toString();	§1.13.6
}
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.
Parameters:
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.
Parameters:
width - the width
height - the height

Methods

toString

public String toString()
Returns:
a string representation of this dimension.
Overrides:
toString in class Object (I-§1.12.9).

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com