Grid Layout & Insets
import java.applet.*;
import java.awt.*;
/*<applet code="GridLayoutDemo" width=300 height=300></applet>*/
public class GridLayoutDemo extends Applet
{
public void init()
{
setLayout(new GridLayout(3,2));
Button b1=new Button("Button 1");
Button b2=new Button("Button 2");
Button b3=new Button("Button 3");
Button b4=new Button("Button 4");
Button b5=new Button("Button 5");
Button b6=new Button("Button 6");
add(b1);
add(b2);
add(b3);
add(b4);
add(b5);
add(b6);
}
public Insets getInsets()
{
return new Insets(10,10,10,10);
}
}
Comments
Post a Comment