From 10866cba33b339de23e5a4e3121ab86c08b5ff2a Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 1 Oct 2012 17:11:42 +0100 Subject: [PATCH] JAL-1130 more robust loading code and different logos for desktop icon and splashscreen icon --- src/jalview/gui/SplashScreen.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index 6fcb6a0..7f55f8b 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -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) { -- 1.7.10.2