void (JComponent c) { if (c.isEnabled()) { myDisabledComponents.add(c); c.setEnabled(false); } for (Component component : c.getComponents()) { if (component instanceof JComponent) { disable((JComponent)component); } } }