Java tutorial
//package com.java2s; import java.awt.Component; import javax.swing.SwingUtilities; public class Main { public static void repaint(final Component component) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { component.repaint(); } }); } }