code: public void execute()
      {
          Runnable task = new Runnable()
          {
              public void run()
              {
                  try
                  {
                      final V result = performTask();
                      SwingUtilities.invokeLater(new Runnable()
                      {
                          public void run()
                          {
                              postProcessing(result);
                              latch.countDown();
                          }
                      });
                  }
                  // If an exception occurs performing the task, we need
                  // to handle it.
                  catch (final Throwable throwable)
                  {
                      SwingUtilities.invokeLater(new Runnable()
                      {
                          public void run()
                          {
                              onError(throwable);
                              latch.countDown();
                          }
                      });
                  }
              }
          };
          new Thread(task, "SwingBackgroundTask-" + id).start();
      }
docs: Asynchronous call that begins execution of the task and returns immediately.
  The {@link #performTask()} method will be invoked on a background thread and,
  when it has completed, {@link #postProcessing(Object)} will be invoked on the
  Event Dispatch Thread (or, if there is an exception, {@link #onError(Throwable)}
  will be invoked instead - also on the EDT).
  @see #performTask()
  @see #postProcessing(Object)
  @see #onError(Throwable)
  @see #waitForCompletion()