2010-10-06 87 views

回答

10

(這是我所知道的和作品,雖然我不知道這是否是正確使用Window#isShowing,或者我應該用別的東西)

public static boolean isModalDialogShowing() 
{ 
    Window[] windows = Window.getWindows(); 
    if(windows != null) { // don't rely on current implementation, which at least returns [0]. 
     for(Window w : windows) { 
      if(w.isShowing() && w instanceof Dialog && ((Dialog)w).isModal()) 
       return true; 
     } 
    } 
    return false; 
} 
+0

先生,你是一個野獸! – FonzTech 2017-08-26 23:31:36

相關問題