Java tutorial
//package com.java2s; //License from project: Open Source License import javax.swing.SwingUtilities; public class Main { /** * Check if on the GUI event dispatch thread. * * @return true if on the event dispatch thread */ static public boolean isGUIThread() { return SwingUtilities.isEventDispatchThread(); } }