Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 2046)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 2047)
@@ -11,4 +11,5 @@
 import java.awt.event.KeyEvent;
 import java.io.File;
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -30,4 +31,5 @@
 import javax.swing.UIManager;
 
+import org.openstreetmap.josm.actions.OpenFileAction;
 import org.openstreetmap.josm.actions.SaveAction;
 import org.openstreetmap.josm.actions.downloadtasks.DownloadGpsTask;
@@ -412,7 +414,7 @@
             dialog.setVisible(true);
             switch(dialog.getUserAction()) {
-            case CANCEL: return false;
-            case PROCEED: return true;
-            default: return false;
+                case CANCEL: return false;
+                case PROCEED: return true;
+                default: return false;
             }
         }
@@ -455,6 +457,6 @@
 
         switch(ed.getValue()) {
-        case 2: /* discard and exit */ return true;
-        case 3: /* cancel */ return false;
+            case 2: /* discard and exit */ return true;
+            case 3: /* cancel */ return false;
         }
         boolean savefailed = false;
@@ -486,6 +488,7 @@
 
         if (s.startsWith("file:")) {
+            File f = null;
             try {
-                main.menu.openFile.openFile(new File(new URI(s)));
+                f = new File(new URI(s));
             } catch (URISyntaxException e) {
                 JOptionPane.showMessageDialog(
@@ -496,4 +499,17 @@
                 );
             }
+            try {
+                if (f!=null) {
+                    OpenFileAction.openFile(f);
+                }
+            }catch(IOException e) {
+                e.printStackTrace();
+                JOptionPane.showMessageDialog(
+                        Main.parent,
+                        tr("<html>Could not read file ''{0}\''.<br> Error is: <br>{1}</html>", f.getName(), e.getMessage()),
+                        tr("Error"),
+                        JOptionPane.ERROR_MESSAGE
+                );
+            }
             return;
         }
@@ -508,6 +524,16 @@
             }
         }
-
-        main.menu.openFile.openFile(new File(s));
+        File f = new File(s);
+        try {
+            OpenFileAction.openFile(f);
+        }catch(IOException e) {
+            e.printStackTrace();
+            JOptionPane.showMessageDialog(
+                    Main.parent,
+                    tr("<html>Could not read file ''{0}\''.<br> Error is: <br>{1}</html>", f.getName(), e.getMessage()),
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE
+            );
+        }
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 2046)
+++ trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 2047)
@@ -8,4 +8,6 @@
 import java.io.File;
 import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
 
 import javax.swing.JFileChooser;
@@ -13,6 +15,9 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.io.FileImporter;
+import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.xml.sax.SAXException;
 
 /**
@@ -37,29 +42,6 @@
             return;
         File[] files = fc.getSelectedFiles();
-        for (int i = files.length; i > 0; --i) {
-            openFile(files[i-1]);
-        }
-    }
-
-    /**
-     * Open the given file.
-     */
-    public void openFile(File file) {
-        try {
-            System.out.println("Open file: " + file.getAbsolutePath() + " (" + file.length() + " bytes)");
-            for (FileImporter importer : ExtensionFileFilter.importers)
-                if (importer.acceptFile(file)) {
-                    importer.importData(file);
-                }
-        } catch (IOException x) {
-            x.printStackTrace();
-            JOptionPane.showMessageDialog(
-                    Main.parent,
-                    tr("<html>Could not read file ''{0}\''. Error is: <br>{1}</html>", file.getName(), x.getMessage()),
-                    tr("Error"),
-                    JOptionPane.ERROR_MESSAGE
-            );
-
-        }
+        OpenFileTask task = new OpenFileTask(Arrays.asList(files));
+        Main.worker.submit(task);
     }
 
@@ -68,3 +50,52 @@
         setEnabled(! Main.applet);
     }
+
+    static public void openFile(File f) throws IOException {
+        for (FileImporter importer : ExtensionFileFilter.importers)
+            if (importer.acceptFile(f)) {
+                importer.importData(f);
+            }
+    }
+
+    static public class OpenFileTask extends PleaseWaitRunnable {
+        private List<File> files;
+        private boolean cancelled;
+
+        public OpenFileTask(List<File> files) {
+            super(tr("Opening files"), false /* don't ignore exception */);
+            this.files = files;
+        }
+        @Override
+        protected void cancel() {
+            this.cancelled = true;
+        }
+
+        @Override
+        protected void finish() {
+            // do nothing
+        }
+
+        @Override
+        protected void realRun() throws SAXException, IOException, OsmTransferException {
+            if (files == null || files.isEmpty()) return;
+            getProgressMonitor().setTicks(files.size());
+            for (File f : files) {
+                if (cancelled) return;
+                getProgressMonitor().subTask(tr("Opening file ''{0}'' ...", f.getAbsolutePath()));
+                try {
+                    System.out.println("Open file: " + f.getAbsolutePath() + " (" + f.length() + " bytes)");
+                    openFile(f);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    JOptionPane.showMessageDialog(
+                            Main.parent,
+                            tr("<html>Could not read file ''{0}\''.<br> Error is: <br>{1}</html>", f.getName(), e.getMessage()),
+                            tr("Error"),
+                            JOptionPane.ERROR_MESSAGE
+                    );
+                }
+                getProgressMonitor().worked(1);
+            }
+        }
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/FileDrop.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/FileDrop.java	(revision 2046)
+++ trunk/src/org/openstreetmap/josm/gui/FileDrop.java	(revision 2047)
@@ -9,8 +9,10 @@
 import java.io.PrintStream;
 import java.io.Reader;
+import java.util.Arrays;
 import java.util.List;
 
 import javax.swing.BorderFactory;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.OpenFileAction;
 
@@ -70,23 +72,19 @@
 
     /* Constructor for JOSM file drop */
-    public FileDrop(final java.awt.Component c)
-    {   this(
-            null,  // Logging stream
-            c,     // Drop target
-            BorderFactory.createMatteBorder( 2, 2, 2, 2, defaultBorderColor ), // Drag border
-            true, // Recursive
-            new FileDrop.Listener()
-            {
-                public void filesDropped( java.io.File[] files )
-                {
-                    OpenFileAction ofa = new OpenFileAction();
-                    for( int i = 0; i < files.length; i++ )
-                    {
-                        ofa.openFile(files[i]);
-                    }   // end for: through each dropped file
-                }   // end filesDropped
-            }); // end FileDrop.Listener
+    public FileDrop(final java.awt.Component c){
+        this(
+                null,  // Logging stream
+                c,     // Drop target
+                BorderFactory.createMatteBorder( 2, 2, 2, 2, defaultBorderColor ), // Drag border
+                true, // Recursive
+                new FileDrop.Listener(){
+                    public void filesDropped( java.io.File[] files ){
+                        // start asynchronous loading of files
+                        OpenFileAction.OpenFileTask task = new OpenFileAction.OpenFileTask(Arrays.asList(files));
+                        Main.worker.submit(task);
+                    }
+                }
+        );
     }
-
 
     /**
