Java Swing UI Thread Event doLaterOnEventThread(Runnable task)

Here you can find the source of doLaterOnEventThread(Runnable task)

Description

Schedule a task for later execution on the even dispatch thread and return immediately.

License

Open Source License

Parameter

Parameter Description
task The task to execute.

Declaration

public static void doLaterOnEventThread(Runnable task) 

Method Source Code


//package com.java2s;
/*//from   w  w w .  j  a va  2s .c  o  m
 * WorldPainter, a graphical and interactive map generator for Minecraft.
 * Copyright ? 2011-2015  pepsoft.org, The Netherlands
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import javax.swing.*;

public class Main {
    /**
     * Schedule a task for later execution on the even dispatch thread and
     * return immediately. The task <em>may</em> be executed on a different
     * thread, so it must be thread-safe.
     *
     * @param task The task to execute.
     */
    public static void doLaterOnEventThread(Runnable task) {
        SwingUtilities.invokeLater(task);
    }
}

Related

  1. dispatchOnAWTThreadNow(Runnable r)
  2. dispatchToEDT(Runnable runnable)
  3. doInBackground(final Runnable r)
  4. doInBackground(final Runnable runnable)
  5. doLater(final long milliseconds, final Runnable doThis)
  6. doOnEventThreadAndWait(Runnable task)
  7. doSwing(Runnable r)
  8. edtExecutor()
  9. edtInvokeLater(Runnable block)