package edu.school;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
* Информатика, 8 клас, издателство Просвета, 2017
* Автори: Светла Бойчева, Николина Николова, Елиза Стефанова, Антон Денев
* 
* Задача: Като следвате стъпките от предходния урок,
* създайте приложение Wishes, което при натискане на бутон извежда в стандартна
* диалогова кутия пожелание към приятелите ви.
* 
* Версия 1.
*/

public class WishesFrame extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					WishesFrame frame = new WishesFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public WishesFrame() {
		setTitle("Wishes");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 275, 184);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new BorderLayout(0, 0));

		JLabel lblInfo = new JLabel(
				"\u041C\u043E\u0435\u0442\u043E \u043F\u043E\u0436\u0435\u043B\u0430\u043D\u0438\u0435 \u0437\u0430 \u0442\u0435\u0431 \u0435...");
		lblInfo.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblInfo.setHorizontalAlignment(SwingConstants.CENTER);
		contentPane.add(lblInfo, BorderLayout.NORTH);

		JButton btnMessage = new JButton("\u0412\u0438\u0436 \u0442\u0443\u043A!");
		btnMessage.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				JOptionPane.showMessageDialog(null, "Програмирай смело с Java!");
			}
		});
		btnMessage.setForeground(new Color(0, 102, 0));
		btnMessage.setFont(new Font("Tahoma", Font.BOLD, 12));
		contentPane.add(btnMessage, BorderLayout.CENTER);
		
		JButton btnExit = new JButton("\u041A\u0440\u0430\u0439");
		btnExit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}
		});
		contentPane.add(btnExit, BorderLayout.SOUTH);
	}

}
