From 1d6782e1c01674bc6b35e0c3ad264d233b1b598a Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 23 Apr 2010 14:20:46 +0000 Subject: [PATCH] thread off a Filechooser instance on startup to make the dialog open quicker later on. --- src/jalview/gui/Desktop.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index e00f993..fa4e483 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -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(); } /** -- 1.7.10.2