public class stringtester {
public static void main(String[] args){
JFrame frame = new JFrame();
Container container = frame.getContentPane();
container.setLayout(new GridLayout(10,10));
for(int i =0; i<5; i++)
for(int j=0; j<5; j++)
if(i>=j){
container.add(new JButton("X"));
}
else{ container.add(new JLabel());
}
frame.setSize(500,500);
frame.setVisible(true);
I'm confused in how the grid layout adds the buttons in terms of order, could someone explain to me how it does so?
Thanks

