Program-3.2: //write Java Program To Demonstrate Grid of 5 5
Program-3.2: //write Java Program To Demonstrate Grid of 5 5
Program-3.2: //write Java Program To Demonstrate Grid of 5 5
2
//Write java Program to demonstrate grid of 5*5
import java.awt.*;
import java.applet.*;
public class GridLayout_Demo1 extends Applet
{
GridLayout g;
Button
b0,b1,b2,b3,b4,b5,b6,b7,b8,b9;
public void init()
{
g=new
GridLayout(5,2);
setLayout(g);
b0=new
Button("A");
b1=new
Button("B");
b2=new
Button("C");
b3=new
Button("D");
b4=new
Button("E");
b5=new
Button("F");
b6=new
Button("G");
b7=new
Button("H");
b8=new
Button("I");
b9=new
Button("J");
add(b0);
add(b1);
add(b2);
add(b3);
add(b4);
add(b5);
add(b6);
add(b7);
add(b8);
add(b9);
/*<applet
code="GridLayout_Demo1.class
" width=300
height=300></applet>*/