// can probably be merged with next variant static void disposeWindow(final Window window) { if (window != null) awtIfNecessary { window.dispose(); } } static void disposeWindow(final Component c) { disposeWindow(getWindow(c)); }