Java Swing UI Thread Event runInEventDispatchThread(final Runnable r)

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

Description

run In Event Dispatch Thread

License

Open Source License

Declaration

public static void runInEventDispatchThread(final Runnable r) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.SwingUtilities;

public class Main {
    public static void runInEventDispatchThread(final Runnable r) {
        if (SwingUtilities.isEventDispatchThread()) {
            r.run();/*  w w  w .j a  v  a 2  s .c om*/
        } else {
            SwingUtilities.invokeLater(r);
        }
    }
}

Related

  1. runInDispatchThread(Runnable r)
  2. runInEDT(final Runnable runnable)
  3. runInEDT(final Supplier supplier)
  4. runInEdt(Runnable r)
  5. runInEDTAndWait(Runnable task)
  6. runInEventDispatchThread(Runnable r)
  7. runInEventDispatchThread(Runnable runnable)
  8. runInEventDispatchThread(Runnable runnable)
  9. runInEventDispatchThreadAndWait(final Runnable r)