GridLayout layout = new GridLayout(2, 2, 0, 0); setLayout(layout); button1 = new Button("Button1"); button2 = new Button("Button2"); button3 = new Button("Button3"); button4 = new Button("Button4"); add(button1); add(button2); add(button3); add(button4);