void (final JComponent component) { for (Component child : component.getComponents()) { if (child instanceof JComponent) { revalidateRecursive((JComponent)child); } } component.revalidate(); component.repaint(); }