@Override
	public void actionPerformed(ActionEvent e) {
		if(users.getAlreadyLogged()) {
			JOptionPane.showMessageDialog(frame,
			    "Wyloguj sie przed ponownym logowaniem.",
			    "Blad logowania.",
			    JOptionPane.ERROR_MESSAGE);
		}
		else if (loginField.getText().equals("") || pwdField.getText().equals("")){
			JOptionPane.showMessageDialog(frame,
				    "Podaj nazwe uzytkownika i haslo.",
				    "Blad logowania.",
				    JOptionPane.ERROR_MESSAGE);
		}
		else {
			String user= loginField.getText();
			String password = pwdField.getText();
			
			checkUserPasswordAndRole(user, password);
			
			
		}
		
		loginField.setText("");
		pwdField.setText("");
	}