static void disposeFrame(final Component c) { awtIfNecessary { Frame f = getFrame(c); if (f != null) f.dispose(); } }