Java Swing UI Thread Event invokeLaterOnEDT(Runnable runnable)

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

Description

invoke Later On EDT

License

Open Source License

Declaration

public static void invokeLaterOnEDT(Runnable runnable) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2014 Open Door Logistics (www.opendoorlogistics.com)
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v3
 * which accompanies this distribution, and is available at http://www.gnu.org/licenses/lgpl.txt
 ******************************************************************************/

import javax.swing.SwingUtilities;

public class Main {
    public static void invokeLaterOnEDT(Runnable runnable) {
        try {/*from   www  . j a  va 2  s.c o m*/
            if (SwingUtilities.isEventDispatchThread()) {
                runnable.run();
            } else {
                SwingUtilities.invokeLater(runnable);
            }
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. invokeInSwingThread(Runnable r)
  2. invokeLater(final Runnable r)
  3. invokeLater(Runnable runnable, boolean forceLater)
  4. invokeLaterEDT(final Runnable runnable)
  5. invokeLaterIfNeeded(Runnable runnable)
  6. invokeNow(Runnable runnable)
  7. invokeNowOrLater(Runnable run)
  8. invokeOnEDT(final Object target, final String methodName, final Object... args)
  9. invokeOnEDT(final Runnable aRunnable)