0

So I created a simple java program(not important) and in eclipse I have a gif file that is the splash screen. When I exported the program into a jar the splash screen came up blank. Any help with this? Thanks in advance. Here is the main class:

package com.ethan.main;


import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JWindow;
import javax.swing.SwingConstants;



public class SingAlong {

     public static void main (String args[]) {
         int close = 0;
         JWindow window1 = new JWindow();
         window1.getContentPane().add(
             new JLabel("", new ImageIcon("res/Backgrounds/Final GIF.gif"), SwingConstants.LEFT));
         window1.setBounds(0, 100, 300, 200);
         window1.setVisible(true);
         if(close == 1){
             window1.dispose();
         }

         try {
             Thread.sleep(6850);
             close = 1;
         } 
         catch (InterruptedException e) {
             e.printStackTrace();
         }


         JFrame window = new JFrame("Science Quiz");
            window.setContentPane(new SingAlongMain());
            window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            window.setResizable(true);
            window.pack();
            window.setVisible(true);


}
}
Ethan
  • 35
  • 2

0 Answers0