List of usage examples for javax.swing JComponent paintImmediately
public void paintImmediately(Rectangle r)
From source file:Main.java
/** * Forces an immediate repaint of a component and all of its children. * * @param component/*from w w w . j av a2 s . c o m*/ */ public static void paintImmediately(Component component) { // Paint the component if (component instanceof JComponent) { JComponent jcomponent = (JComponent) component; jcomponent.paintImmediately(jcomponent.getBounds()); } // Recursively paint children if (component instanceof Container) { Container container = (Container) component; int numberOfChildren = container.getComponentCount(); for (int i = 0; i < numberOfChildren; i++) { Component child = container.getComponent(i); paintImmediately(child); } } }