All About Class Insets in AWT in Java

0
174
Spread the love
  • 29
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    138
    Shares

Class Insets in AWT in Java

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

Insets class holds four values that represent the top, left, bottom, and right margins, in pixels, of a Container or other Component. Objects of this type may be specified in a GridBagConstraints layout object, and are returned by Container.insets(), which queries the margins of a container.

public class java.awt.Insets extends java.lang.Object implements java.lang.Cloneable,java.io.Serializable{
//member elements
public int bottom;//Insets from the bottom
public int left;//Insets from the left
public int right;//Insets from the right
public int top;//Insets from the top
//constructor
public Insets(int top,int left,int bottom,int right);
//creates and initializes a new Insets with the specified top,left,bottom and right insets.
//methods
public Object clone();//returns a copy of this insets
public String toString();//Returns the string representation of this insets.
} 
 
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 29
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    138
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here