X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSplashScreen.java;h=c159cd29961247a023387d3d74491b8a46316cda;hb=266c4e2544701f88a8d21294b4a4f4cc42cf76cc;hp=a033ec72facaa4d66740cea24f54a8409f4f449d;hpb=2ff861c30f5ff9c7b9fe014b87135f6c7591e24d;p=jalview.git diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index a033ec7..c159cd2 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -43,10 +43,25 @@ public class SplashScreen * @param iframe DOCUMENT ME! * @param i DOCUMENT ME! */ - public SplashScreen(JInternalFrame iframe, Image i) + public SplashScreen() { - this.iframe = iframe; - image = i; + try + { + java.net.URL url = getClass().getResource("/images/logo.gif"); + + if (url != null) + { + image = java.awt.Toolkit.getDefaultToolkit().createImage(url); + + MediaTracker mt = new MediaTracker(this); + mt.addImage(image, 0); + mt.waitForID(0); + Desktop.instance.setIconImage(image); + } + } + catch (Exception ex) + { + } Thread t = new Thread(this); t.start(); @@ -63,6 +78,19 @@ public class SplashScreen } } }); + + iframe = new JInternalFrame(); + iframe.setFrameIcon(null); + iframe.setClosable(false); + iframe.setContentPane(this); + iframe.setLayer(JLayeredPane.PALETTE_LAYER); + + Desktop.desktop.add(iframe); + + iframe.setVisible(true); + iframe.setBounds( (int) ( (Desktop.instance.getWidth() - 750) / 2), + (int) ( (Desktop.instance.getHeight() - 160) / 2), + 750, 160); } /** @@ -77,7 +105,6 @@ public class SplashScreen try { Thread.sleep(1000); - repaint(); } catch (Exception ex) { @@ -87,6 +114,8 @@ public class SplashScreen { visible = false; } + else + repaint(); } closeSplash(); @@ -99,6 +128,7 @@ public class SplashScreen { try { + iframe.setClosed(true); } catch (Exception ex)