Java tutorial
//package com.java2s; import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; import static javax.swing.SwingUtilities.invokeLater; public class Main { public static <T> FutureTask<T> callLater(final Callable<T> callable) { final FutureTask<T> futureTask = new FutureTask<>(callable); invokeLater(futureTask); return futureTask; } }