Java Swing UI Thread Event dispatchOnAWTThreadLater(Runnable r)

Here you can find the source of dispatchOnAWTThreadLater(Runnable r)

Description

dispatch On AWT Thread Later

License

Open Source License

Declaration

public static void dispatchOnAWTThreadLater(Runnable r) 

Method Source Code

//package com.java2s;
/*------------------------------------------------------------------
 * Copyright (c) 2014 Cisco Systems//from  w  w  w  .  j a  va2s. c om
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *------------------------------------------------------------------*/

import javax.swing.SwingUtilities;

public class Main {
    public static void dispatchOnAWTThreadLater(Runnable r) {
        if (SwingUtilities.isEventDispatchThread()) {
            r.run();
        } else {
            SwingUtilities.invokeLater(r);
        }

    }
}

Related

  1. assertEventDispatcherThread()
  2. assertIsEDT()
  3. assertNotEventDispatchThread()
  4. callOnGUIThread(Runnable runnable)
  5. checkForEventDispatchThread()
  6. dispatchOnAWTThreadNow(Runnable r)
  7. dispatchToEDT(Runnable runnable)
  8. doInBackground(final Runnable r)
  9. doInBackground(final Runnable runnable)