// assumes frame is supposed to be visible right now svoid waitForFrameClose(JFrame f) { if (!isVisible(f)) ret; new Flag flag; onFrameClose(f, flag.raise()); flag.waitUntilUp(); }