thread off a Filechooser instance on startup to make the dialog open quicker later on.
authorjprocter <Jim Procter>
Fri, 23 Apr 2010 14:20:46 +0000 (14:20 +0000)
committerjprocter <Jim Procter>
Fri, 23 Apr 2010 14:20:46 +0000 (14:20 +0000)
src/jalview/gui/Desktop.java

index e00f993..fa4e483 100755 (executable)
@@ -157,6 +157,18 @@ public class Desktop extends jalview.jbgui.GDesktop implements
 
     discoverer = new jalview.ws.Discoverer(); // Only gets started if gui is
     // displayed.
+    // Thread off a new instance of the file chooser - this reduces the time it takes to open it later on.
+    new Thread(new Runnable() {
+      public void run() {
+        Cache.log.debug("Filechooser init thread started.");
+        JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
+                .getProperty("LAST_DIRECTORY"),
+                jalview.io.AppletFormatAdapter.READABLE_EXTENSIONS,
+                jalview.io.AppletFormatAdapter.READABLE_FNAMES,
+                jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
+        Cache.log.debug("Filechooser init thread finished.");
+      }
+    }).start();
   }
 
   /**