Reputation: 45
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.
Upvotes: 0
Views: 516
Reputation: 56
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)
{
try
{
Thread.sleep(2000); //Leave Splash up for 2 seconds
splash.close();
}
catch(InterruptedException e) { LOG.log(Level.INFO, "Spash Sleep Interrupted", e); }
}
else
{
LOG.info("Splash Screen is null");
}
Or do something in another thread while main sleeps
Upvotes: 2