private void Ok()
	{
		if(loginTextField.getText().length() == 0)
		{
			JOptionPane.showMessageDialog(rf, "Enter login");
			return;
		}
		if(loginTextField.getText().length() < 4)
		{
			JOptionPane.showMessageDialog(rf, "Login is to short, it should be longer then 3 characters");
			return;
		}
		if(passTextField.getText().length() == 0)
		{
			JOptionPane.showMessageDialog(rf, "Enter password");
			return;
		}
		if(passTextField.getText().length() < 5)
		{
			JOptionPane.showMessageDialog(rf, "Password is to short, it should be longer then 6 characters");
			return;
		}
		if(passConfTextField.getText().length() == 0)
		{
			JOptionPane.showMessageDialog(rf, "Confirm password");
			return;
		}
		if(!passConfTextField.getText().equals(passTextField.getText()))
		{
			JOptionPane.showMessageDialog(rf, "Passwords do not match");
			return;
		}
		try 
		{
			if(!link.Registrate(loginTextField.getText(), passTextField.getText()))
			{
				JOptionPane.showMessageDialog(rf, "Login is already used");
				return;
			}
			else
			{
				JOptionPane.showMessageDialog(rf, "Registration completed successful");
				frame.setVisible(true);
				rf.dispose();
			}
		} 
		catch (RemoteException e1) 
		{
			JOptionPane.showMessageDialog(rf, "No connection with server");
			rf.dispose();
			lf.setVisible(true);
		}
	}