Class Insets
java.lang.Object
java.awt.Insets
- All Implemented Interfaces:
Serializable, Cloneable
- Direct Known Subclasses:
InsetsUIResource
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:
- 1.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInsets(int top, int left, int bottom, int right) Creates and initializes a newInsetsobject with the specified top, left, bottom, and right insets. -
Method Summary
Modifier and TypeMethodDescriptionclone()Create a copy of this object.booleanChecks whether two insets objects are equal.inthashCode()Returns the hash code for this Insets.voidset(int top, int left, int bottom, int right) Set top, left, bottom, and right to the specified valuestoString()Returns a string representation of thisInsetsobject.Methods declared in class Object
finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Field Details
-
top
public int topThe inset from the top. This value is added to the Top of the rectangle to yield a new location for the Top.- See Also:
-
left
public int leftThe 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:
-
bottom
public int bottomThe inset from the bottom. This value is subtracted from the Bottom of the rectangle to yield a new location for the Bottom.- See Also:
-
right
public int rightThe 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:
-
-
Constructor Details
-
Insets
public Insets(int top, int left, int bottom, int right) Creates and initializes a newInsetsobject 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 Details
-
set
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
Checks whether two insets objects are equal. Two instances ofInsetsare equal if the four integer values of the fieldstop,left,bottom, andrightare all equal. -
hashCode
-
toString
Returns a string representation of thisInsetsobject. 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 benull. -
clone
-