package ru.mai.dep806.panel;

import javafx.event.ActionEvent;
import ru.mai.dep806.table.Table1;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

/**
 * Created by K_A_Volchica on 18.06.2015.
 */
public class SimplePanel extends JPanel{
    public JPanel panel;
    public JTextField rules;
    public JTextField number1;
    public JTextField number2;
    public JButton result;
    public JTable table;

    public SimplePanel()
    {
setLayout(new BorderLayout());


        panel = new JPanel();

        rules=new JTextField("Введите два положительных числа меньше 50");
        panel.add(rules, BorderLayout.NORTH);

        number1=new JTextField("Первое число");
        panel.add(number1, BorderLayout.EAST);

        number2=new JTextField("Второе число");
        panel.add(number2, BorderLayout.WEST);

        result=new JButton("Результат");
        panel.add(result,BorderLayout.SOUTH);


       ActionListener command = result.addActionListener(new ActionListener(number1.getText(), number2.getText()) {
        @Override
        public void actionPerformed(java.awt.event.ActionEvent e) {
            String a;
            String b;


            int i = new Integer(a);
            int j = new Integer(b);


                JPanel p = new JPanel();
                JTable table = new Table1(i, j);

            }


    }



}

}

