Java Swing UI Thread Event assertEventDispatcherThread()

Here you can find the source of assertEventDispatcherThread()

Description

Assert we are in the event dispatching thread.

License

Open Source License

Declaration

public static void assertEventDispatcherThread() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.*;

public class Main {
    /**//ww  w  .ja va2 s .c om
     * Assert we are in the event dispatching thread.
     */
    public static void assertEventDispatcherThread() {
        if (!SwingUtilities.isEventDispatchThread())
            throw new IllegalStateException("Not an AWT thread.");
    }
}

Related

  1. assertIsEDT()
  2. assertNotEventDispatchThread()
  3. callOnGUIThread(Runnable runnable)
  4. checkForEventDispatchThread()