Java Swing UI Thread Event doInBackground(final Runnable r)

Here you can find the source of doInBackground(final Runnable r)

Description

do In Background

License

Open Source License

Declaration

public static void doInBackground(final Runnable r) 

Method Source Code


//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();
    }
}

Related

  1. callOnGUIThread(Runnable runnable)
  2. checkForEventDispatchThread()
  3. dispatchOnAWTThreadLater(Runnable r)
  4. dispatchOnAWTThreadNow(Runnable r)
  5. dispatchToEDT(Runnable runnable)
  6. doInBackground(final Runnable runnable)
  7. doLater(final long milliseconds, final Runnable doThis)
  8. doLaterOnEventThread(Runnable task)
  9. doOnEventThreadAndWait(Runnable task)