GridLayout example
public class TestGridLayout extends Frame {
public static void main(String[] args) {
TestGridLayout tgl = new TestGridLayout();
tgl.setLayout(new GridLayout(0, 3, 10, 10));
for(int i=1; i<=9; i++) {
tgl.add(new Button("Button Nr." + i));