package swing.layouty;

import java.awt.Font;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

public class Layout_Grid {
	private final static Font FONT = new Font("Arial", Font.BOLD, 30);

	public static void main(String[] args) {
		final JFrame okno = new JFrame();
		okno.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		GridLayout layout = new GridLayout(2, 4, 10, 20);
		okno.setLayout(layout);
		
		final JButton button1 = new JButton("A");
		button1.setFont(FONT);
		okno.add(button1);
		final JButton button2 = new JButton("B");
		button2.setFont(FONT);
		okno.add(button2);
		final JButton button3 = new JButton("C");
		button3.setFont(FONT);
		okno.add(button3);
		final JButton button4 = new JButton("D");
		button4.setFont(FONT);
		okno.add(button4);
		final JButton button5 = new JButton("E");
		button5.setFont(FONT);
		okno.add(button5);
		final JButton button6 = new JButton("F");
		button6.setFont(FONT);
		okno.add(button6);
		final JButton button7 = new JButton("G");
		button7.setFont(FONT);
		okno.add(button7);
		final JButton button8 = new JButton("H");
		button8.setFont(FONT);
		okno.add(button8);
		final JButton button9 = new JButton("J");
		button9.setFont(FONT);
		okno.add(button9);
		
		okno.pack();
		okno.setVisible(true);
	}

}
