List of utility methods to do Swing UI Thread Event
void | executeTask(final Runnable task, final boolean async) execute Task if (async) { SwingUtilities.invokeLater(task); } else { if (SwingUtilities.isEventDispatchThread()) { task.run(); } else { try { SwingUtilities.invokeAndWait(task); ... |
List | getInstalledThemes(LookAndFeel laf) get Installed Themes return Collections.EMPTY_LIST;
|
void | invoke(Runnable r) invoke if (SwingUtilities.isEventDispatchThread()) r.run(); else SwingUtilities.invokeLater(r); |
void | invoke(Runnable runnable) invoke dispatch(runnable); |
void | invoke(Runnable runnable) invoke if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { try { SwingUtilities.invokeAndWait(runnable); } catch (InvocationTargetException | InterruptedException e) { throw new RuntimeException(e); |
void | invokeAfter(final Runnable execute, int after) Runs the supplied class after a certain period of time, the thread will be executed in the EDT. Timer timer = new Timer(after, new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { execute.run(); }); timer.setRepeats(false); timer.start(); |
void | invokeAndContiune(Runnable runnable) invoke And Contiune if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeLater(runnable); |
void | invokeAndWait(final Runnable r) Runs r in the event dispatch thread, which may be the current thread. if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { SwingUtilities.invokeAndWait(r); |
void | invokeAndWait(Runnable task) invoke And Wait if (SwingUtilities.isEventDispatchThread()) { task.run(); } else { try { SwingUtilities.invokeAndWait(task); } catch (Exception ex) { ex.printStackTrace(); |
void | invokeAndWaitAsNeeded(Runnable r) Invokes the given runnable on the Swing UI dispatch thread, blocking until the runnable has completed. if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { try { SwingUtilities.invokeAndWait(r); } catch (InterruptedException | InvocationTargetException e) { e.printStackTrace(); Thread.currentThread().interrupt(); ... |