JRE-861 Project Libs and Global Libs cannot be created from the UI
diff --git a/src/macosx/native/sun/awt/CFileDialog.m b/src/macosx/native/sun/awt/CFileDialog.m
index 652cd31..cbd7d77 100644
--- a/src/macosx/native/sun/awt/CFileDialog.m
+++ b/src/macosx/native/sun/awt/CFileDialog.m
@@ -182,9 +182,11 @@
                         fURLs = [NSArray array];
                     }
                     [fURLs retain];
-                    [NSApp stopModal];
-                }
-            ];
+
+                    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
+                        [NSApp stopModal];
+                    }];
+            }];
 
             [NSApp runModalForWindow:thePanel];
         }