public void login(String username, String password) {
		// Get instance of ConfigManager from file
		ConfigManager cm = new ConfigManager();

		try {
			// Try to connect to RMI through port 1099
			Registry registry = LocateRegistry.getRegistry(cm.getServerIp(),
					1099);
			Rmi rmi = (Rmi) registry.lookup("pcs");

			// Send login data
			RmiData socketData = rmi.getData(username, password);

			// If login details are correct
			if (socketData.getLoginResult()) {
				// Store username and password for future updates
				this.username = username;
				this.password = password;
				socketData.saveToFile(); // save Rmi data to file

				// Show client view frame and close the login view
				clientView = new ClientView(this, username);
				clientView.getFrame().setVisible(true);
				loginView.getFrame().dispose();

				// Start updater thread
				clientUpdater = new ClientUpdater();
				clientUpdater.start();
			} else {
				// Login failed
				JOptionPane.showMessageDialog(null,
						"Login failed. Make sure of username and password.");
			}
		} catch (RemoteException | NotBoundException e) {
			// Problem with the server connection
			JOptionPane.showMessageDialog(null, "Could not connect to server.");
			e.printStackTrace();
		}
	}