private static void disposeOtherWindows(final JFrame jf, final JFrame jf2) {
        Window[] windows = Frame.getOwnerlessWindows();
        for (Window window : windows) {
            if (!window.getName().equals(jf) && !window.getName().equals(jf2)) {
                window.dispose();
            }
        }
    }