protected Integer doInBackground() throws Exception {
            // Do a time-consuming task.
            try {

                jProgressBar1.setMaximum(4);
                jTextField1.setEnabled(false);
                jPasswordField1.setEnabled(false);
                jProgressBar1.setValue(1);

                UserDTO userDTO = new UserDTO();
                userDTO.setLogin(jTextField1.getText());
                userDTO.setPassword(jPasswordField1.getPassword());

                client.getOut().writeObject(
                        new Command(CommandType.USER_LOGIN, userDTO));
                jProgressBar1.setValue(2);

                Result result = null;
                Object object = client.getIn().readObject();
                if (object instanceof Result) {
                    result = (Result) object;
                }
                if (result != null && !result.isHasError()) {
                    jProgressBar1.setValue(3);
                    jLabel3.setText("Login");
                    jProgressBar1.setValue(4);
                    // getParent().setVisible(true);
                    Client.setUser((UserDTO) result.getResult());
                    System.out.println(Client.getUser());
                } else {
                    jProgressBar1.setValue(3);
                    jLabel3.setText(result.getError());
                    jProgressBar1.setValue(0);
                    jTextField1.setEnabled(true);
                    jPasswordField1.setEnabled(true);

                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            return 42;
        }