Index: /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 2993)
+++ /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 2994)
@@ -19,4 +19,5 @@
 import javax.swing.JFileChooser;
 import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
 import javax.swing.filechooser.FileFilter;
 
@@ -94,10 +95,10 @@
 
         protected void alertFilesNotMatchingWithImporter(Collection<File> files, FileImporter importer) {
-            StringBuffer msg = new StringBuffer();
+            final StringBuffer msg = new StringBuffer();
             msg.append("<html>");
             msg.append(
                     trn(
-                            "Cannot open {0} file with the file importer ''{1}''. Skipping the following files:",
-                            "Cannot open {0} files with the file importer ''{1}''. Skipping the following files:",
+                            "Cannot open {0} file with the file importer ''{1}''.",
+                            "Cannot open {0} files with the file importer ''{1}''.",
                             files.size(),
                             files.size(),
@@ -111,20 +112,24 @@
             msg.append("</ul>");
 
-            HelpAwareOptionPane.showOptionDialog(
-                    Main.parent,
-                    msg.toString(),
-                    tr("Warning"),
-                    JOptionPane.WARNING_MESSAGE,
-                    HelpUtil.ht("/Action/OpenFile#ImporterCantImportFiles")
-            );
+            SwingUtilities.invokeLater(new Runnable() {
+                public void run() {
+                    HelpAwareOptionPane.showOptionDialog(
+                            Main.parent,
+                            msg.toString(),
+                            tr("Warning"),
+                            JOptionPane.WARNING_MESSAGE,
+                            HelpUtil.ht("/Action/OpenFile#ImporterCantImportFiles")
+                    );
+                }
+            });
         }
 
         protected void alertFilesWithUnknownImporter(Collection<File> files) {
-            StringBuffer msg = new StringBuffer();
+            final StringBuffer msg = new StringBuffer();
             msg.append("<html>");
             msg.append(
                     trn(
-                            "Cannot open {0} file because no suitable file importer is available. Skipping the following files:",
-                            "Cannot open {0} files because no suitable file importer is available. Skipping the following files:",
+                            "Cannot open {0} file because no suitable file importer is available.",
+                            "Cannot open {0} files because no suitable file importer is available.",
                             files.size(),
                             files.size()
@@ -136,12 +141,16 @@
             }
             msg.append("</ul>");
-
-            HelpAwareOptionPane.showOptionDialog(
-                    Main.parent,
-                    msg.toString(),
-                    tr("Warning"),
-                    JOptionPane.WARNING_MESSAGE,
-                    HelpUtil.ht("/Action/OpenFile#MissingImporterForFiles")
-            );
+            
+            SwingUtilities.invokeLater(new Runnable() {
+                public void run() {
+                    HelpAwareOptionPane.showOptionDialog(
+                            Main.parent,
+                            msg.toString(),
+                            tr("Warning"),
+                            JOptionPane.WARNING_MESSAGE,
+                            HelpUtil.ht("/Action/OpenFile#MissingImporterForFiles")
+                    );
+                }
+            });
         }
 
@@ -172,10 +181,18 @@
                 List<File> filesNotMatchingWithImporter = new LinkedList<File>();
                 List<File> filesMatchingWithImporter = new LinkedList<File>();
-                for (File f : files) {
+                for (final File f : files) {
                     if (!chosenImporter.acceptFile(f)) {
                         if (f.isDirectory()) {
-                            JOptionPane.showMessageDialog(Main.parent, tr(
-                                    "<html>Cannot open directory ''{0}''.<br>Please select a file.</html>", f
-                                    .getAbsolutePath()), tr("Open file"), JOptionPane.ERROR_MESSAGE);
+                            SwingUtilities.invokeLater(new Runnable() {
+                                public void run() {
+                                    JOptionPane.showMessageDialog(Main.parent, tr(
+                                            "<html>Cannot open directory ''{0}''.<br>Please select a file.</html>", 
+                                            f.getAbsolutePath()), tr("Open file"), JOptionPane.ERROR_MESSAGE);
+                                }
+                            });
+                            // TODO when changing to Java 6: Don't cancel the 
+                            // task here but use different modality. (Currently 2 dialogs
+                            // would block each other.)
+                            return;
                         } else {
                             filesNotMatchingWithImporter.add(f);
@@ -188,6 +205,10 @@
                 if (!filesNotMatchingWithImporter.isEmpty()) {
                     alertFilesNotMatchingWithImporter(filesNotMatchingWithImporter, chosenImporter);
-                }
-                if (!filesNotMatchingWithImporter.isEmpty()) {
+                    // TODO when changing to Java 6: Don't cancel the 
+                    // task here but use different modality. (Currently 2 dialogs
+                    // would block each other.)
+                    return;
+                }
+                if (!filesMatchingWithImporter.isEmpty()) {
                     importData(chosenImporter, filesMatchingWithImporter);
                 }
@@ -209,4 +230,8 @@
                 if (!filesWithUnknownImporter.isEmpty()) {
                     alertFilesWithUnknownImporter(filesWithUnknownImporter);
+                    // TODO when changing to Java 6: Don't cancel the 
+                    // task here but use different modality. (Currently 2 dialogs
+                    // would block each other.)
+                    return;
                 }
                 List<FileImporter> ims = new ArrayList<FileImporter>(map.keySet());
