Hi all,
i have the follwong code and what i supposed after going thru the code that i will get a Frame with panel in one of the grids and inside that panel i will have two buttons. but the panel occupies the total area of Frame . pls Explain this behavior of GridLayout..
Thanks in Advance....
Here the Code Goes...
import java.awt.*;
public class LayoutFrame extends Frame{
public LayoutFrame()
{
setLayout(new GridLayout(1, 3));
Button b = new Button("What is b location?");
Button a = new Button("What is a location?");
Panel p1 = new Panel();
p1.setLayout(new GridLayout(2, 1));
p1.add(a);
p1.add(b);
add(p1);
}
public static void main(
String args[]) {
LayoutFrame tf = new LayoutFrame();
tf.setSize(300,400);
tf.setVisible(true);
}
}