package testtool.login2_ui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.GridLayout;
import javax.swing.*;

import testtool.testimport_ui.*;

public class Login2 extends JFrame{
	private JTextField Username = new JTextField();
	private JTextField Password = new JTextField();
	private JComboBox Server = new JComboBox();
	private JButton Cancel = new JButton("Cancel");
	private JButton Login = new JButton("Login");
	
	public Login2() {
		setTitle("Login");
		setLayout(new GridLayout(4, 3));
		addGUIListeners();
		addGUIs();
		setSize(300,150);
		setVisible(true);
		Server.setEditable(true);
	
	}

	private void addGUIListeners(){
		Cancel.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){			
				System.out.println("Cancel button selected.");
				//pop up the new test window 
				setVisible(false);
			}
		});
		Login.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){			
				System.out.println("Test released to server.");
				//pop up the new test window 
				setVisible(false);
				new TestImport();
			}
		});
	}
	
	private void addGUIs(){
		add(new JLabel("Username"));
		add(Username);
		add(new JLabel(""));
		add(new JLabel("Password"));
		add(Password);
		add(new JLabel(""));
		add(new JLabel("Server"));
		add(Server);
		add(new JLabel(""));
		add(new JLabel(""));
		add(Cancel);
		add(Login);
	}
		
}