List of utility methods to do Swing UI Thread Event
T | resultOfOnEventThread(final Callable Execute a task on the event dispatch thread and return the result. if (SwingUtilities.isEventDispatchThread()) { try { return task.call(); } catch (Exception e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } else { throw new RuntimeException(e.getClass().getSimpleName() + " thrown by task", e); ... |
void | runAndWaitOnEDT(Runnable r) run And Wait On EDT if (EventQueue.isDispatchThread()) { r.run(); } else { try { SwingUtilities.invokeAndWait(r); } catch (InvocationTargetException e) { e.printStackTrace(); |
void | runAndWaitOnEDT(Runnable runnable) Run on EDT if not already on EDT. try { if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeAndWait(runnable); } catch (Throwable e) { throw new RuntimeException(e); ... |
void | runInDispatchThread(Runnable r) run In Dispatch Thread if (!SwingUtilities.isEventDispatchThread()) { try { SwingUtilities.invokeAndWait(r); } catch (Exception e) { throw new RuntimeException(e); } else { r.run(); ... |
void | runInEDT(final Runnable runnable) run In EDT if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeLater(runnable); |
T | runInEDT(final Supplier Runs arbitrary code in the Event Dispatch Thread. return runInEDT(supplier, null);
|
void | runInEdt(Runnable r) run In Edt if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { SwingUtilities.invokeLater(r); |
void | runInEDTAndWait(Runnable task) run In EDT And Wait if (SwingUtilities.isEventDispatchThread()) { task.run(); } else { try { SwingUtilities.invokeAndWait(task); } catch (InterruptedException e) { e.printStackTrace(); } catch (InvocationTargetException e) { ... |
void | runInEventDispatchThread(final Runnable r) run In Event Dispatch Thread if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { SwingUtilities.invokeLater(r); |
void | runInEventDispatchThread(Runnable r) run In Event Dispatch Thread if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { SwingUtilities.invokeLater(r); |