<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.awt.Dimension
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.Dialog.html#_top_">Previous</a>  <a href="java.awt.Event.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.Dimension
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.awt.Dimension
</pre>
<hr>
<dl>
  <dt> public class <b>Dimension</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
  <dt> implements <a href="java.io.Serializable.html#_top_">Serializable</a>
</dl>
The <code>Dimension</code> class encapsulates the width and 
 height of a component in a single object. The class is 
 associated with certain properties of components. Several methods 
 defined by the <code>Component</code> class and the 
 <code>LayoutManager</code> interface return a 
 <code>Dimension</code> object. 
 <p>
 Normally the values of <code>width</code> 
 and <code>height</code> are non-negative integers. 
 The constructors that allow you to create a dimension do 
 not prevent you from setting a negative value for these properties. 
 If the value of <code>width</code> or <code>height</code> is 
 negative, the behavior of some methods defined by other objects is 
 undefined.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Component.html#_top_">Component</a>, <a href="java.awt.LayoutManager.html#_top_">LayoutManager</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#height"><b>height</b></a>
  <dd>  The height dimension.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#width"><b>width</b></a>
  <dd>  The width dimension.
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Dimension()"><b>Dimension</b></a>()
  <dd> 
 Creates an instance of <code>Dimension</code> with a width 
 of zero and a height of zero.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Dimension(java.awt.Dimension)"><b>Dimension</b></a>(Dimension)
  <dd> 
 Creates an instance of <code>Dimension</code> whose width  
 and height are the same as for the specified dimension.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Dimension(int, int)"><b>Dimension</b></a>(int, int)
  <dd> 
 Constructs a Dimension and initializes it to the specified width and
 specified height.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#equals(java.lang.Object)"><b>equals</b></a>(Object)
  <dd>  Checks whether two dimension objects have equal values.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getSize()"><b>getSize</b></a>()
  <dd>  Gets the size of this <code>Dimension</code> object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setSize(java.awt.Dimension)"><b>setSize</b></a>(Dimension)
  <dd>  Set the size of this <code>Dimension</code> object to the specified size.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setSize(int, int)"><b>setSize</b></a>(int, int)
  <dd>  Set the size of this <code>Dimension</code> object 
 to the specified width and height.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Returns a string that represents this 
 <code>Dimension</code> object's values.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="width"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>width</b>
<pre>
 public int width
</pre>
<dl>
  <dd> The width dimension.<p>
</dl>
<a name="height"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>height</b>
<pre>
 public int height
</pre>
<dl>
  <dd> The height dimension.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Dimension"></a>
<a name="Dimension()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Dimension</b>
<pre>
 public Dimension()
</pre>
<dl>
  <dd> Creates an instance of <code>Dimension</code> with a width 
 of zero and a height of zero.
<p>
</dl>
<a name="Dimension(java.awt.Dimension)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Dimension</b>
<pre>
 public Dimension(<a href="#_top_">Dimension</a> d)
</pre>
<dl>
  <dd> Creates an instance of <code>Dimension</code> whose width  
 and height are the same as for the specified dimension.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> d - the specified dimension for the
               <code>width</code> and 
               <code>height</code> values.
  </dl></dd>
</dl>
<a name="Dimension(int, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Dimension</b>
<pre>
 public Dimension(int width,
                  int height)
</pre>
<dl>
  <dd> Constructs a Dimension and initializes it to the specified width and
 specified height.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> width - the specified width dimension
    <dd> height - the specified height dimension
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getSize"><b>getSize</b></a>
<pre>
 public <a href="#_top_">Dimension</a> getSize()
</pre>
<dl>
  <dd> Gets the size of this <code>Dimension</code> object.
 This method is included for completeness, to parallel the
 <code>getSize</code> method defined by <code>Component</code>.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the size of this dimension, a new instance of
           <code>Dimension</code> with the same width and height.
    <dt> <b>See Also:</b>
    <dd> <a href="#setSize">setSize</a>, <a href="java.awt.Component.html#getSize">getSize</a>
  </dl></dd>
</dl>
<a name="setSize(java.awt.Dimension)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setSize"><b>setSize</b></a>
<pre>
 public void setSize(<a href="#_top_">Dimension</a> d)
</pre>
<dl>
  <dd> Set the size of this <code>Dimension</code> object to the specified size.
 This method is included for completeness, to parallel the
 <code>setSize</code> method defined by <code>Component</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> d - the new size for this <code>Dimension</code> object.
    <dt> <b>See Also:</b>
    <dd> <a href="#getSize">getSize</a>, <a href="java.awt.Component.html#setSize">setSize</a>
  </dl></dd>
</dl>
<a name="setSize(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setSize"><b>setSize</b></a>
<pre>
 public void setSize(int width,
                     int height)
</pre>
<dl>
  <dd> Set the size of this <code>Dimension</code> object 
 to the specified width and height.
 This method is included for completeness, to parallel the
 <code>setSize</code> method defined by <code>Component</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> width - the new width for this <code>Dimension</code> object.
    <dd> height - the new height for this <code>Dimension</code> object.
    <dt> <b>See Also:</b>
    <dd> <a href="#getSize">getSize</a>, <a href="java.awt.Component.html#setSize">setSize</a>
  </dl></dd>
</dl>
<a name="equals(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="equals"><b>equals</b></a>
<pre>
 public boolean equals(<a href="java.lang.Object.html#_top_">Object</a> obj)
</pre>
<dl>
  <dd> Checks whether two dimension objects have equal values.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#equals(java.lang.Object)">equals</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Returns a string that represents this 
 <code>Dimension</code> object's values.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of this dimension,
                  including the values of <code>width</code> 
                  and <code>height</code>.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.Dialog.html#_top_">Previous</a>  <a href="java.awt.Event.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
