gpt4 book ai didi

Java 9+ 相当于 list 定义的启动屏幕

转载 作者:行者123 更新时间:2023-12-02 09:15:46 25 4
gpt4 key购买 nike

我最近将我的应用程序从 Java 8 升级到 Java 12。我曾经作为可运行的 jar 文件进行分发,但现在分发可运行的镜像。过去,我在 list 中定义了一个启动屏幕,它将在应用程序加载时显示(并且在我的一行代码运行之前)。既然我已经从从 jar 文件运行切换到从图像运行,是否有任何等效的功能可以使用?

最佳答案

查看 java.awt.SplashScreen 的文档:

If the Java implementation provides the command-line interface and you run your application by using the command line or a shortcut, use the Java application launcher option to show a splash screen. The Oracle reference implementation allows you to specify the splash screen image location with the -splash: option.

For example:

java -splash:filename.gif Test

java命令:

-splash:imagepath

Shows the splash screen with the image specified by imagepath. HiDPI scaled images are automatically supported and used if available. The unscaled image file name, such as image.ext, should always be passed as the argument to the -splash option. The most appropriate scaled image provided is picked up automatically.

For example, to show the splash.gif file from the images directory when starting your application, use the following option:

-splash:images/splash.gif

关于Java 9+ 相当于 list 定义的启动屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59003361/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com