Here you can find the source of doLaterOnEventThread(Runnable task)
Parameter | Description |
---|---|
task | The task to execute. |
public static void doLaterOnEventThread(Runnable task)
//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); } }