JLabel splashLabel;
JWindow splashScreen; public void showSplashScreen()
  {
        splashLabel = new JLabel(new ImageIcon(getClass().getResource("/logo.gif")));
    
        splashScreen = new JWindow();
        splashScreen.getContentPane().add(splashLabel);
        splashScreen.pack();
        Rectangle screenRect = getGraphicsConfiguration().getBounds();
        splashScreen.setLocation(
         screenRect.x + screenRect.width/2 - splashScreen.getSize().width/2,
         screenRect.y + screenRect.height/2 - splashScreen.getSize().height/2);
    
    
        splashScreen.show();
   }public void hideSplash()
   {
    if(splashScreen!=null)
    {
        splashScreen.setVisible(false);
        splashScreen.dispose();
        splashScreen = null;
        splashLabel = null;
    }