@Override
    public void actionPerformed(ActionEvent e) {
        JButton button = (JButton) e.getSource();

        if (button == jbnChangePass) {
            if (jtfNewPass.getText().equals("") || jtfConfirmNewPass.getText().equals("")) {
                JOptionPane.showMessageDialog(null, "Please, fill all empty fields.");
                return;
            }

            if (!jtfNewPass.getText().equals(jtfConfirmNewPass.getText())) {
                JOptionPane.showMessageDialog(null, "Passwords are not equals. Please, try again.");
                return;
            }

            userDAO.updatePassword(user.getId(), jtfConfirmNewPass.getText());
            JOptionPane.showMessageDialog(null, "Password was changed successfully.");
            jtfNewPass.setText("");
            jtfConfirmNewPass.setText("");
        }


        if (button == jbnUpdate) {
            if (jtfUser.getText().equals("")) {
                JOptionPane.showMessageDialog(null, "First choose user from the list.");
            }

            userDAO.updateUser(jtfUser.getText(), jcbBlock.isSelected(), jcbLimitation.isSelected());
            JOptionPane.showMessageDialog(null, "Updated successfully.");
        }

        if (button == jbnExit) {
            dispose();
            new Login();
        }


    }