public boolean showDialog() {
    Frame[] frames = Frame.getFrames();
    for (int i = 0; i < frames.length; i++) {
      if (frames[i].isAlwaysOnTop()) {
        frames[i].setAlwaysOnTop(false);
        if (frames[i].isFocused()) win = (Window)frames[i];
      }
    }
    return super.showDialog(null);
  }