package swing.podstawy;

import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.LayoutManager;

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

public class Okno3f_Grid {
	public static void main(String[] args) {
		System.out.println("Początek main");
		
		JFrame okno = new JFrame("Nasza apka");
		okno.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		okno.setSize(600, 400);
		
		LayoutManager layout = new GridLayout(2, 2);
		okno.setLayout(layout);
		
		JLabel label1 = new JLabel("Ala ma kota");
		
		label1.setHorizontalAlignment(JLabel.CENTER);
		label1.setFont(new Font("Arial", Font.BOLD, 30));
		label1.setForeground(Color.RED);
		okno.add(label1);
		
		JLabel label2 = new JLabel("Ola ma psa");
		label2.setHorizontalAlignment(JLabel.RIGHT);
		label2.setFont(new Font("Arial", Font.ITALIC, 30));
		label2.setForeground(Color.BLUE);
		okno.add(label2);
		
		JButton button1 = new JButton("Kliknij mnie");
		button1.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 30));
		button1.setForeground(Color.GREEN);
		okno.add(button1);

		JButton button2 = new JButton("Guzik 2");
		button2.setFont(new Font("Arial", Font.BOLD, 30));
		button2.setForeground(Color.MAGENTA);
		okno.add(button2);

		okno.setVisible(true);

		System.out.println("Koniec main");
	}

}
