Here you can find the source of doInBackground(final Runnable r)
public static void doInBackground(final Runnable r)
//package com.java2s; //License from project: Open Source License import javax.swing.SwingWorker; public class Main { public static void doInBackground(final Runnable r) { new SwingWorker<Void, Void>() { @Override/*from w ww . j a va 2s . c o m*/ protected Void doInBackground() { r.run(); return null; } }.execute(); } }