src/Pure/General/swing.scala
author haftmann
Thu, 05 Feb 2009 14:14:02 +0100
changeset 29806 bebe5a254ba6
parent 29649 8b0c1397868e
child 29777 f3284860004c
permissions -rw-r--r--
moved Random.thy to Library

/*  Title:      Pure/General/swing.scala
    Author:     Makarius

Swing utilities.
*/

package isabelle

import javax.swing.SwingUtilities

object Swing
{
  def now(body: => Unit) {
    if (SwingUtilities.isEventDispatchThread) body
    else SwingUtilities.invokeAndWait(new Runnable { def run = body })
  }

  def later(body: => Unit) {
    if (SwingUtilities.isEventDispatchThread) body
    else SwingUtilities.invokeLater(new Runnable { def run = body })
  }
}