static void disposePossiblyInternalFrame(Component c) { Container f = cast getPossiblyInternalFrame(c); if (f instanceof JInternalFrame) disposeInternalFrame((JInternalFrame) f); else if (f instanceof Window) disposeWindow(f); }