List of utility methods to do Swing UI Thread Event
void | runInEventDispatchThread(Runnable runnable) Ensure that the specified ruannable task will run only in the event dispatch thread. if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeLater(runnable); |
void | runInEventDispatchThread(Runnable runnable) run In Event Dispatch Thread try { if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeAndWait(runnable); } catch (InterruptedException | InvocationTargetException e) { throw new RuntimeException(e); ... |
void | runInEventDispatchThreadAndWait(final Runnable r) run In Event Dispatch Thread And Wait if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { try { SwingUtilities.invokeAndWait(r); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (InterruptedException e) { ... |
void | runInSwingThread(final Runnable runnable) run In Swing Thread if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { try { SwingUtilities.invokeAndWait(runnable); } catch (final InvocationTargetException | InterruptedException e) { throw new RuntimeException(e); |
void | runInSwingThread(Runnable runnable) run In Swing Thread try { if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { runLater(runnable); } catch (Exception e) { throw new RuntimeException(e); ... |
void | runLater(Runnable runnable) run Later SwingUtilities.invokeLater(runnable); |
void | runLaterAndWait(final Runnable runnable) Run the given runnable in the EDT and wait until its finished. final CountDownLatch l_latch = new CountDownLatch(1); SwingUtilities.invokeLater(new Runnable() { public void run() { runnable.run(); l_latch.countDown(); }); while (true) { ... |
void | runModalProcess(String title, final Runnable runnable) run Modal Process final JProgressBar progressBar = new JProgressBar(); progressBar.setIndeterminate(true); final JPanel contentPane = new JPanel(); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); contentPane.setLayout(new BorderLayout()); contentPane.add(new JLabel(title), BorderLayout.NORTH); contentPane.add(progressBar, BorderLayout.CENTER); |
void | runNowInEdt(Runnable runnable) run Now In Edt if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeAndWait(runnable); |
void | runOnDispatchThread(Runnable runnable) run On Dispatch Thread if (EventQueue.isDispatchThread()) { runnable.run(); } else { try { SwingUtilities.invokeAndWait(runnable); } catch (InvocationTargetException e) { Throwable t = e.getCause(); if (t instanceof Error) ... |