title: How to wait for some action to be completed using progress indicator in javafx?
body: <p>I am having one code that send command to server.</p>
  
  <pre><code>public static void createAndSendCommand(String action, byte[] data) {
      if (action.equals(OE_Constants.ACTION_UPDATE)) {
          File file = new File(OE_Constants.FILE_BACKUP_TOPOLOGY);
          Command command = ConnectionManager.populateData(file);
          FrontEndClient.sendCommandToServer(command);
      }
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public static boolean sendCommandToServer(Command command) {
      try {
          outStream.writeObject(command);
          return true;
      } catch (Exception e) {
          e.printStackTrace();
      }
      return false;
  }
  </code></pre>
  
  <p>And I am receiving result like below.</p>
  
  <pre><code>public void receiveResultFromServer() {
      try {
          while(!clientSocket.isClosed()) {
              CommandExecResult result;
              try {
                  result = (CommandExecResult) inStream.readObject();
                  ConnectionManager.parseCommandExecutionResult(result);
              } catch (ClassNotFoundException e) {
                  e.printStackTrace();
              }catch (IOException e) {
                  e.printStackTrace();
              }
          }
      }
  }
  </code></pre>
  
  <p>Now I want to wait for command to be successfully executed on server till the result of it is received by client. I want to show some Progress indicator type  of UI ....how to do that?
  Thanks!</p>