posted 23 years ago
import java.awt.*;
import java.applet.Applet;
public class glay6 extends Applet{
public void init(){
Button b=new Button("Hi");
add (b);
Button cb=new Button("Hello");
add (cb);
Button bc=new Button("Hell");
add (bc);
Button c=new Button("Hel");
add (c);
Button acb=new Button("He");
add (acb);
Button cba=new Button("H");
add (cba);
Button ba=new Button("H");
add (ba);
setLayout(new GridLayout(5,0));
}
}
Here I thought we should get
row1 col1 -Hi
row1 col2 -Hello
row2 col1 -Hell
row2 col2 -Hel
row3 col1 -He
row3 col2 -H
row4 col1 -H
But I am getting only one H.The lastone row4 col1 H is not visible.I think it should be there as I have created a new Button for each.Only the caption is the same.
Can anyone explain