private void jButton1ActionPerformed(ActionEvent evt) {
		try {
	         
	        socket = new Socket("127.0.0.1",2009);
	        login = jTextField1.getText();
	        password = new String(jPasswordField1.getPassword());	        
	        LoginCheck lc = new LoginCheck(socket);
	        IDcheck = lc.Check(login, password);
	        if (!IDcheck){
	        	JOptionPane.showMessageDialog(this, "Bad login and/or password.");
	        }
	        else{
	        	t2 = new Thread(new ChatWindow(socket,login));
                t2.start();
                this.dispose();
	        }
       
	         
	         
	         
	    } catch (UnknownHostException e) {
	      System.err.println("Can't connect to address "+socket.getLocalAddress());
	    } catch (IOException e) {
	      System.err.println("No server listening on port "+socket.getLocalPort());
	    }
	}