I am experimenting with GridLayout.I thought the following code should give
b1 b2 b3 b4 b5
b6 b7 b8 - -
But when I run it.What I get is
b1 b2 b3 b4
b5 b6 b7 b8.Can some one explain this.What I understood was the rows and cols are allocated first and the components are filled in them.Some one please help me understand.
/**code*/
import java.awt.*;
public class GridAp extends Frame{
public static void main(
String argv[]){
GridAp fa=new GridAp();
//Setup GridLayout with 2 rows and 5 columns
fa.setLayout(new GridLayout(2,5));
fa.setSize(400,300);
fa.setVisible(true);
}
GridAp(){
add(new Button("One"));
add(new Button("Two"));
add(new Button("Three"));
add(new Button("Four"));
add(new Button("Five"));
add(new Button("Six"));
add(new Button("Seven"));
add(new Button("Eight"));
}//End of constructor
}//End of Application