Currently, I am showing splash screen in my desktop application using the following way
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.0
Created-By: 1.6.0_12-b04 (Sun Microsystems Inc.)
Main-Class: org.yccheok.jstock.gui.MainFrame
SplashScreen-Image: images/splash/jstock2-wording.png
Class-Path: lib/library.lib
X-COMMENT: Main-Class will be added automatically by build
However, some users request to disable the splash screen during startup.
I know I can achieve this, by not using facility provided by Manifest file.
Instead, I write my own custom Java code.
To read a config file, and decide whether to spawn a thread to show a splash screen before the main application launching.
However, I still prefer to use the facility provided by Manifest instead of writing my own code.
Is there any way I can disable the splash screen, if user wish to do so?
Thanks.
The simple solution would be to provide the user with a version of the JAR that didn’t have the splash-screen-image manifest entry.
The only other option is to write a wrapper script or native code launcher for your app, and have that run the java command using the “-splash” option … or not … depending on a script argument, environment variable or preference file.
According to the javadoc, it is only possible to use the native splash screen via the command line option or the JAR file manifest entry. So if you want some clever / user friendly way to turn the splash screen on/off via a user preference file, your custom launcher has to read the preference file and do what needs to be done before you launch the JVM.