/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tictac;

/**
 *
 * @author Abdulrahman
 */
import java.awt.BorderLayout;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.*;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.text.Style;

public class Language extends JFrame {

    JPanel p1 = new JPanel(new GridLayout(2, 0));
    JPanel p2 = new JPanel(new GridLayout(0, 2));
    JLabel lb1 = new JLabel("Choose your language please:");
    JLabel lb2 = new JLabel("اختر لغتك رجاء: ");
    JButton eng = new JButton("English");
    JButton Ar = new JButton("عربي");
    Font f1 = new Font("Dialog", Font.BOLD, 14);

    public Language() {
        setBackground(Color.YELLOW);
        p1.add(lb1);
        p1.add(lb2);
        lb1.setFont(f1);
        lb2.setFont(f1);
        p2.add(eng);
        p2.add(Ar);




        add(p1, BorderLayout.NORTH);
        add(p2, BorderLayout.CENTER);
        eng.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                TicTacToeEn starter = new TicTacToeEn();
                starter.startIt();
            }
        });

        Ar.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                TicTacToeAr starter = new TicTacToeAr();
                starter.startIt();
            }
        });
    }

    public static void main(String[] args) {
        Language frame = new Language();
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(250, 150);
        frame.setLocationRelativeTo(null);


    }
}
