X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSplashScreen.java;h=c159cd29961247a023387d3d74491b8a46316cda;hb=266c4e2544701f88a8d21294b4a4f4cc42cf76cc;hp=9f4429af6666bbfdf0abbbfcfa3815e81bc2e298;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index 9f4429a..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); } /** @@ -74,19 +102,20 @@ public class SplashScreen while (visible) { - if ( ( (System.currentTimeMillis() / 1000) - startTime) > 5) - { - visible = false; - } - try { Thread.sleep(1000); - repaint(); } catch (Exception ex) { } + + if ( ( (System.currentTimeMillis() / 1000) - startTime) > 5) + { + visible = false; + } + else + repaint(); } closeSplash(); @@ -99,12 +128,11 @@ public class SplashScreen { try { + iframe.setClosed(true); } catch (Exception ex) - { - ex.printStackTrace(); - } + { } } /**