JAL-1130 more robust loading code and different logos for desktop icon and splashscre...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 1 Oct 2012 16:11:42 +0000 (17:11 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 1 Oct 2012 16:11:42 +0000 (17:11 +0100)
src/jalview/gui/SplashScreen.java

index 6fcb6a0..7f55f8b 100755 (executable)
@@ -94,15 +94,23 @@ public class SplashScreen extends JPanel implements Runnable, HyperlinkListener
     try
     {
       java.net.URL url = getClass().getResource("/images/Jalview_Logo.png");
+      java.net.URL urllogo = getClass().getResource("/images/Jalview_Logo_small.png");
 
       if (url != null)
       {
         image = java.awt.Toolkit.getDefaultToolkit().createImage(url);
-
+        Image logo=java.awt.Toolkit.getDefaultToolkit().createImage(urllogo);
         MediaTracker mt = new MediaTracker(this);
         mt.addImage(image, 0);
-        mt.waitForID(0);
-        Desktop.instance.setIconImage(image);
+        mt.addImage(logo, 1);
+        do { try {
+          mt.waitForAll(); } catch (InterruptedException x) {};
+          if (mt.isErrorAny())
+          {
+            System.err.println("Error when loading images!");
+          }
+        } while (!mt.checkAll());
+        Desktop.instance.setIconImage(logo);
       }
     } catch (Exception ex)
     {