import java.awt.*;
public class b extends Frame{
int x;
b(){
setLayout(new GridLayout());
add(new Panel());
add(new Button("One"));
add(new Button("Two"));
setLayout(new BorderLayout());
add(new Button("Three"), "North");
add(new Button("Four"), "South");
#line1 //setLayout( new FlowLayout());
add ( new Button("My Shining Button"));
}
public static void main(
String[] arguments){
b fa=new b();
fa.setSize(400,300);
fa.setVisible(true);
}
}
The above source code gives frame with buttons at north, south and center.
But if you uncomment line #1 it gives 5 buttons in a row.
Can anyone pls explain why??
Thanks in adavance.