CeciliA CeciliA - 19 days ago 5x
Java Question

How to add Splash Screen on a Project that runs normally if you make it a JAR file

My problem guys is if im adding splash screen on netbeans. There`s an error if you build the project to make it a JAR file. Is there a way for me to add a Splash Screen that works in a JAR file? Thanks in Advance guys.

Here is my Property Panel

enter image description here


You need to add it to the manifest.mf file above the line:

 X-COMMENT: Main-Class will be added automatically by build

Then leave it up for a while in main method if you want:

 SplashScreen splash = SplashScreen.getSplashScreen();
 if(splash != null)
        Thread.sleep(2000); //Leave Splash up for 2 seconds
    catch(InterruptedException e) { LOG.log(Level.INFO, "Spash Sleep Interrupted", e); }
    LOG.info("Splash Screen is null");

Or do something in another thread while main sleeps