java.awt
Class Insets

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Insets
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable
Direct Known Subclasses:
InsetsUIResource sample code for javax.swing.plaf.InsetsUIResource definition code for javax.swing.plaf.InsetsUIResource

public class Insets
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

An Insets object is a representation of the borders of a container. It specifies the space that a container must leave at each of its edges. The space can be a border, a blank space, or a title.

Since:
JDK1.0
See Also:
LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager , Container sample code for java.awt.Container definition code for java.awt.Container , Serialized Form

Field Summary
 int bottom sample code for java.awt.Insets.bottom definition code for java.awt.Insets.bottom
          The inset from the bottom.
 int left sample code for java.awt.Insets.left definition code for java.awt.Insets.left
          The inset from the left.
 int right sample code for java.awt.Insets.right definition code for java.awt.Insets.right
          The inset from the right.
 int top sample code for java.awt.Insets.top definition code for java.awt.Insets.top
          The inset from the top.
 
Constructor Summary
Insets sample code for java.awt.Insets.Insets(int, int, int, int) definition code for java.awt.Insets.Insets(int, int, int, int) (int top, int left, int bottom, int right)
          Creates and initializes a new Insets object with the specified top, left, bottom, and right insets.
 
Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.awt.Insets.clone() definition code for java.awt.Insets.clone() ()
          Create a copy of this object.
 boolean equals sample code for java.awt.Insets.equals(java.lang.Object) definition code for java.awt.Insets.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Checks whether two insets objects are equal.
 int hashCode sample code for java.awt.Insets.hashCode() definition code for java.awt.Insets.hashCode() ()
          Returns the hash code for this Insets.
 void set sample code for java.awt.Insets.set(int, int, int, int) definition code for java.awt.Insets.set(int, int, int, int) (int top, int left, int bottom, int right)
          Set top, left, bottom, and right to the specified values
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.awt.Insets.toString() definition code for java.awt.Insets.toString() ()
          Returns a string representation of this Insets object.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

top sample code for java.awt.Insets.top

public int top
The inset from the top. This value is added to the Top of the rectangle to yield a new location for the Top.

See Also:
clone() sample code for java.awt.Insets.clone() definition code for java.awt.Insets.clone()

left sample code for java.awt.Insets.left

public int left
The inset from the left. This value is added to the Left of the rectangle to yield a new location for the Left edge.

See Also:
clone() sample code for java.awt.Insets.clone() definition code for java.awt.Insets.clone()

bottom sample code for java.awt.Insets.bottom

public int bottom
The inset from the bottom. This value is subtracted from the Bottom of the rectangle to yield a new location for the Bottom.

See Also:
clone() sample code for java.awt.Insets.clone() definition code for java.awt.Insets.clone()

right sample code for java.awt.Insets.right

public int right
The inset from the right. This value is subtracted from the Right of the rectangle to yield a new location for the Right edge.

See Also:
clone() sample code for java.awt.Insets.clone() definition code for java.awt.Insets.clone()
Constructor Detail

Insets sample code for java.awt.Insets(int, int, int, int) definition code for java.awt.Insets(int, int, int, int)

public Insets(int top,
              int left,
              int bottom,
              int right)
Creates and initializes a new Insets object with the specified top, left, bottom, and right insets.

Parameters:
top - the inset from the top.
left - the inset from the left.
bottom - the inset from the bottom.
right - the inset from the right.
Method Detail

set sample code for java.awt.Insets.set(int, int, int, int) definition code for java.awt.Insets.set(int, int, int, int)

public void set(int top,
                int left,
                int bottom,
                int right)
Set top, left, bottom, and right to the specified values

Parameters:
top - the inset from the top.
left - the inset from the left.
bottom - the inset from the bottom.
right - the inset from the right.
Since:
1.5

equals sample code for java.awt.Insets.equals(java.lang.Object) definition code for java.awt.Insets.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Checks whether two insets objects are equal. Two instances of Insets are equal if the four integer values of the fields top, left, bottom, and right are all equal.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if the two insets are equal; otherwise false.
Since:
JDK1.1
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for java.awt.Insets.hashCode() definition code for java.awt.Insets.hashCode()

public int hashCode()
Returns the hash code for this Insets.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code for this Insets.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for java.awt.Insets.toString() definition code for java.awt.Insets.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a string representation of this Insets object. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a string representation of this Insets object.

clone sample code for java.awt.Insets.clone() definition code for java.awt.Insets.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Create a copy of this object.

Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a copy of this Insets object.
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable