Java splash command line used in javafx build.xml not working

£可爱£侵袭症+ 提交于 2019-12-11 11:08:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!