List of utility methods to do Swing UI Thread Event
void | runOnEDT(final Runnable r) Runs the given runnable on the event dispatch thread. if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { SwingUtilities.invokeLater(r); |
void | runOnSwingThread(Runnable doRun) Runs the given Runnable on the Swing event dispatch thread. if (SwingUtilities.isEventDispatchThread()) { doRun.run(); } else { SwingUtilities.invokeLater(doRun); |
void | runOnSwingThread(Runnable run) run On Swing Thread if (javax.swing.SwingUtilities.isEventDispatchThread()) { run.run(); } else { runOnSwingThreadLater(run); |
void | runSafe(Runnable runnable) run Safe if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { try { SwingUtilities.invokeAndWait(runnable); } catch (InterruptedException e) { } catch (InvocationTargetException e) { throw new Error(e); ... |
void | runTimer(int duration, final Runnable run) run Timer Timer t = new Timer(duration, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { run.run(); }); t.setRepeats(false); t.start(); ... |
void | safeGUIRun(Runnable runnable) safe GUI Run if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeLater(runnable); |
void | safelyRunBlockingRoutine(Runnable runnable) safely Run Blocking Routine if (SwingUtilities.isEventDispatchThread()) { new Thread(runnable).start(); } else { runnable.run(); |
void | safeSwingCall(@Nonnull final Runnable runnable) safe Swing Call if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeLater(runnable); |
void | saveInvokeAndWait(Runnable run) save Invoke And Wait if (SwingUtilities.isEventDispatchThread()) run.run(); else { try { SwingUtilities.invokeAndWait(run); } catch (Exception _e) { throw new RuntimeException(_e); |
void | throwIfNotOnEDT() throw If Not On EDT if (!SwingUtilities.isEventDispatchThread()) { throw new RuntimeException(); |