@SuppressWarnings("deprecation") private void replaceSurfaceDataRecursively(Component c) { if (c instanceof Container) { for (Component child : ((Container) c).getComponents()) { replaceSurfaceDataRecursively(child); } } ComponentPeer cp = c.getPeer(); if (cp instanceof WComponentPeer) { ((WComponentPeer) cp).replaceSurfaceDataLater(); } }