Java Swing UI Thread Event dispatchToEDT(Runnable runnable)

Here you can find the source of dispatchToEDT(Runnable runnable)

Description

dispatch To EDT

License

Open Source License

Declaration

public static void dispatchToEDT(Runnable runnable) 

Method Source Code

//package com.java2s;

import javax.swing.SwingUtilities;

public class Main {
    public static void dispatchToEDT(Runnable runnable) {
        if (!SwingUtilities.isEventDispatchThread()) {
            SwingUtilities.invokeLater(runnable);
        } else {/*  w w  w  .j av a2  s  .  co  m*/
            runnable.run();
        }
    }
}

Related

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