@SuppressWarnings("deprecation")
	private void intializeComponent() {
		this.setSize(500, 350);
		//JFrame frame = new JFrame("Login to Indexer");
		this.setTitle("Login to Indexer");

		setLocationRelativeTo(null);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JLabel userLabel = new JLabel("Username:");
		JLabel passLabel = new JLabel("Password:");
		
		userLabel.setBounds(10, 10, 100, 30);
		passLabel.setBounds(10, 50, 100, 30);
		
		username = new JTextField();
		username.setBounds(120, 10, 240, 30);
		
		password = new JPasswordField();
		password.setBounds(120, 50, 240, 30);
		
		ActionListener submit = new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				//assert port != 0;
				//assert host !=null;
				String user = username.getText();
				String pass = password.getText();
				ClientCommunicator cc = new ClientCommunicator(host, port);
				//cc.setSERVER_PORT(port);
				//cc.setSERVER_HOST(host);
				ValidateUser_Params params = new ValidateUser_Params(user,pass);
				ValidateUser_Result result = null;
				try {
					result = cc.validateUser(params);
				} catch (ClientException e1) {
					e1.printStackTrace();
				}
				if (result.getBool().toLowerCase().contains("true")) {
					//TODO: Check file exists. If not new session
					File file = new File("sessions/"+result.getLastName().toLowerCase().trim()+result.getFirstName().toLowerCase().trim()+".session");
					if (file.exists()) {
						s = (Session) xmlStream.fromXML(file);
						s.initiliazeListenersList();
						s.setUrlPrefix("http://"+host+":"+port+"/files/");
						indexer = new Indexer(s);
					} else {
						indexer = new Indexer();
					}
					indexer.getSession().setUsername(user);
					indexer.getSession().setPassword(pass);
					indexer.getSession().setFirstName(result.getFirstName().trim());
					indexer.getSession().setLastName(result.getLastName().trim());
					indexer.getSession().setHost(host);
					indexer.getSession().setPort(port);
					indexer.getSession().setUrlPrefix();
					indexer.getSession().setIndexedRecords(result.getIndexedRecords());
					WindowAlert alert = new WindowAlert(indexer.getSession());
					alert.setVisible(true);
					
					indexer.setVisible(true);
					alert.dispose();
					dis();
				} else {
					ValidationFail fail = new ValidationFail();
					fail.setVisible(true);
					fail.dispose();
				}
				
				
			}
		};
		
		JButton btnLogin = new JButton("Login");
		btnLogin.addActionListener(submit);
		btnLogin.registerKeyboardAction(btnLogin.getActionForKeyStroke(
                KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, false)),
                KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false),
                JComponent.WHEN_FOCUSED);
		btnLogin.registerKeyboardAction(btnLogin.getActionForKeyStroke(
                KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, true)),
                KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, true),
                JComponent.WHEN_FOCUSED);
		btnLogin.setBounds(120, 90, 90, 30);
		
		JButton btnExit = new JButton("Exit");
		btnExit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.exit(-9);
			}
		});
		btnExit.setBounds(210, 90, 90, 30);
		
		this.getContentPane().setLayout(null);
		this.setSize(380, 150);
		this.getContentPane().add(userLabel);
		this.getContentPane().add(passLabel);
		this.getContentPane().add(username);
		this.getContentPane().add(password);
		this.getContentPane().add(btnLogin);
		this.getContentPane().add(btnExit);
		
		
	}