问题
I read the Oracle doc How to Create a Splash Screen,follow the guide, I can make my javafx application show a splash before preloader start on java -jar command.
Then, I add a jvmarg to fx:Platform of fx:depoly in the build.xml file,the jvmarg was <fx:jvmarg value="-splash:res/img/logo.png"/>
, hopely ,I want to show the splash before application preloader start when I launch the application through myApplication.exe that build by fx:deploy , but ,it seems not working.
I also tried with add <attribute name="SplashScreen-Image" value="res/img/logo.png"/>
param to mainfest.mf ,when I launched the application in command line it worked,but when I launched the application through myApplication.exe that build by fx:deploy didn't work again.
So, it's there a way to show the splash screen before javafx preloader start when launch the applcation by myApplication.exe but not through command line?
Below is part of build.xml:
<fx:deploy width="${javafx.run.width}" height="${javafx.run.height}" includeDT="${javafx.deploy.includeDT}" nativeBundles="all" outdir="${basedir}/${dist.dir}" embedJNLP="${javafx.deploy.embedJNLP}" outfile="${application.title}" verbose="true">
<fx:application
name="${application.title}"
mainClass="${javafx.main.class}"/>
<fx:resources>
<fx:fileset dir="dist" includes="*.jar"/>
<fx:fileset dir="dist" includes="libs/*"/>
</fx:resources>
<fx:platform>
<fx:jvmarg value="-Xmx512m"/>
<fx:jvmarg value="-splash:res/img/logo.png"/>
<!--<fx:jvmarg value="-verbose:jni"/>
<property name="my.property" value="something"/>-->
</fx:platform>
<fx:preferences install="false"/>
<info title="${application.title}"
vendor="${application.vendor}"/>
</fx:deploy>
Thanks for the help.
来源:https://stackoverflow.com/questions/37041571/java-splash-command-line-used-in-javafx-build-xml-not-working