package interfaces;

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

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class MainGUInterface extends JFrame {

	private JPanel contentPane;
	private MainGUInterface frame;

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

	/**
	 * Create the frame.
	 */
	public MainGUInterface() {
		frame = this;
		setResizable(false);
		setTitle("Lottery Neural Network Analyzer");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 424, 100);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JButton btnTrain = new JButton("Train");
		btnTrain.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent arg0) {
				TrainGUInterface trainGUInterface = new TrainGUInterface();
				trainGUInterface.setVisible(true);
				frame.dispose();
			}
		});
		btnTrain.setBounds(71, 25, 89, 23);
		contentPane.add(btnTrain);

		JButton btnTest = new JButton("Test");
		btnTest.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				TestGUInterface testGUInterface = new TestGUInterface();
				testGUInterface.setVisible(true);
				frame.dispose();
			}
		});
		btnTest.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent arg0) {
			}
		});
		btnTest.setBounds(265, 25, 89, 23);
		contentPane.add(btnTest);
	}
}
