Mac OS, Java Splash

自作多情 提交于 2019-12-04 12:51:16

Like this, in your Info.plist:

...
<key>Java</key>
    <dict>

    <key>MainClass</key>
    <string>...</string>

    <key>SplashFile</key>
    <string>$APP_PACKAGE/tmp_splash.png</string>
...

In my application:
Info.plist:

    ...
    <dict>
        <key>ClassPath</key>
        <string>$JAVAROOT/@PROJECTNAMEASIDENTIFIER@.jar:@CLASSPATH@</string>
        <key>JVMVersion</key>
        <string>1.6+</string>
        <key>MainClass</key>
        <string>@PROJECTMAINCLASS@</string>
        <key>SplashFile</key>
        <string>$JAVAROOT/splash.png</string>
    ...  

Copy splash.png to myapp.app/Contents/Resources/Java/splash.png
et voila.

You could make your application show a jFrame with decorations off and your picture at the start up of the application

I had the same problem, and found a solution on this thread:

http://lists.apple.com/archives/java-dev/2008/Jun/msg00012.html

It involves adding an entry to the bundled application's Info.plist file after using Jar Bundler. Also, the image needs to be copied to myApp.app/Contents/Resources/Java (at least with the "set working directory inside application package" option). There's probably a better way, but this seems to work.

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