The InsetPanel class is a simple extension of the Java awt Panel class. A InsetPanel is a Panel which contains Insets, which are used by awt classes to indicate the size of a border surrounding the component.
package MyAwt;
import java.awt.*;
public class InsetPanel extends Panel {
private Insets p_insets;
public InsetPanel() {
super();
}
public InsetPanel(Insets insets) {
this();
p_insets=insets;
}
public Insets insets() {
if (p_insets==null)
p_insets=new Insets(0,0,0,0);
return p_insets;
}
public void insets(Insets insets) {
if (insets!=null)
p_insets = insets;
}
}