Java Swing UI Thread Event invokeLater(final Runnable r)

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

Description

invoke Later

License

Open Source License

Declaration

public static void invokeLater(final Runnable r) 

Method Source Code

//package com.java2s;

import javax.swing.SwingUtilities;

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

                @Override
                public void run() {
                    r.run();
                }
            });
        }
    }
}

Related

  1. invokeAndWaitUnchecked(Runnable runnable)
  2. invokeEDT(final Runnable runnable)
  3. invokeInAWTThread(Runnable r)
  4. invokeInEventDispatchThread(@Nonnull Runnable runnable)
  5. invokeInSwingThread(Runnable r)
  6. invokeLater(Runnable runnable, boolean forceLater)
  7. invokeLaterEDT(final Runnable runnable)
  8. invokeLaterIfNeeded(Runnable runnable)
  9. invokeLaterOnEDT(Runnable runnable)