@Override

    public void actionPerformed(ActionEvent e) {

        Response response = null;
        if (loginForm.getLoginValue().length() < 1
                || loginForm.getPasswordValue().length() < 1) {
            JOptionPane.showMessageDialog(loginForm,
                    "You should fill both fields",
                    "Missing login or password", JOptionPane.ERROR_MESSAGE);
        } else {
            List<String> list = new ArrayList<String>();
            list.add(loginForm.getLoginValue());
            list.add(loginForm.getPasswordValue());

            Request request = new Request(RequestCriteria.CHECK_LOGIN, list);
            try {
                response = ServerConnect.connect(request);
            } catch (IOException e1) {
                e1.printStackTrace();
            }
            if (response != null && response.getSuccess() == false) {
                JOptionPane.showMessageDialog(loginForm,
                        "Incorrect login or password",
                        "Failed to log in", JOptionPane.ERROR_MESSAGE);
            } else {
                Application.initAppFrame();
                System.out.println(response != null ? response.getSuccess() : null);

                loginForm.dispose();
            }
        }
    }