package swing.podstawy;

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

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

public class Okno3d_Flow {

	public static void main(String[] args) {
		JFrame frame = new JFrame("Nasza apka");
		frame.setSize(600, 400);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		// LayoutManager layout = new FlowLayout();
		LayoutManager layout = new FlowLayout(FlowLayout.CENTER, 20, 10);
		frame.setLayout(layout);
		
		JLabel label1 = new JLabel("Hello world");
		label1.setHorizontalAlignment(JLabel.CENTER);
		// label1.setVerticalAlignment(JLabel.TOP);
		label1.setFont(new Font("Arial", Font.BOLD, 40));
		label1.setForeground(Color.BLUE);
		label1.setOpaque(true);
		label1.setBackground(Color.YELLOW);
		frame.add(label1);
		
		JLabel label2 = new JLabel("Ala ma kota");
		label2.setFont(new Font("Arial", Font.BOLD, 40));
		frame.add(label2);
		
		JButton button1 = new JButton("Guzik 1");
		button1.setFont(new Font("Arial", Font.BOLD, 32));
		frame.add(button1);
		
		JButton button2 = new JButton("Guzik 2");
		button2.setFont(new Font("Arial", Font.BOLD, 32));
		frame.add(button2);
		
		frame.setVisible(true);
	}

}
