public class Insets extends Object implements Cloneable, 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.
LayoutManager
, Container
, Serialized Formpublic 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.
clone()
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.
clone()
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.
clone()
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.
clone()
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.
top
- the inset from the top.left
- the inset from the left.bottom
- the inset from the bottom.right
- the inset from the right.public void set(int top, int left, int bottom, int right)
Set top, left, bottom, and right to the specified values
top
- the inset from the top.left
- the inset from the left.bottom
- the inset from the bottom.right
- the inset from the right.public boolean equals(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.
equals
in class Object
obj
- the reference object with which to compare.true
if the two insets are equal; otherwise false
.Object.hashCode()
, HashMap
public int hashCode()
Returns the hash code for this Insets.
hashCode
in class Object
Object.equals(java.lang.Object)
, System.identityHashCode(java.lang.Object)
public 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
.
public Object clone()
Create a copy of this object.
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.