Java Swing UI Thread Event invoke(Runnable runnable)

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

Description

invoke

License

Apache License

Declaration

public static void invoke(Runnable runnable) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.SwingUtilities;

public class Main {
    public static void invoke(Runnable runnable) {
        dispatch(runnable);/*  ww  w  . java 2  s.  c  o m*/
    }

    public static void dispatch(Runnable runnable) {
        if (SwingUtilities.isEventDispatchThread()) {
            runnable.run();
        } else {
            SwingUtilities.invokeLater(runnable);
        }
    }
}

Related

  1. executeRunnable(Runnable runnable)
  2. executeTask(final Runnable task, final boolean async)
  3. getInstalledThemes(LookAndFeel laf)
  4. invoke(Runnable r)
  5. invoke(Runnable runnable)
  6. invokeAfter(final Runnable execute, int after)
  7. invokeAndContiune(Runnable runnable)
  8. invokeAndWait(final Runnable r)
  9. invokeAndWait(Runnable task)