我想要显示一个闪屏,它应该停留几秒钟,以便用户可以阅读闪屏中的内容。
通过在 build.xml 中添加以下代码,我已将所有 .jar 文件制作成一个 .jar 文件,
<!-- Change the value of this property to be the name of your JAR, minus the .jar extension. It should not have spaces. <property name="store.jar.name" value="MyJarName"/> --> <property name="store.jar.name" value="store"/> <!-- don't edit below this line --> <property name="store.dir" value="store"/> <property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/> <echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/> <delete dir="${store.dir}"/> <mkdir dir="${store.dir}"/> <jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip"> <zipgroupfileset dir="dist" includes="*.jar"/> <zipgroupfileset dir="dist/lib" includes="*.jar"/> <manifest> <attribute name="Main-Class" value="${main.class}"/> </manifest> </jar> <zip destfile="${store.jar}"> <zipfileset src="${store.dir}/temp_final.jar" excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/> </zip> <delete file="${store.dir}/temp_final.jar"/>
我正在使用netbeans。 jar 文件是通过右键单击构建 xml 文件来创建的,
运行目标 -> 其他目标 -> package-for-store
知道如何构建启动画面并保持几秒钟吗?
谢谢
最佳答案
- 为您自己创建一个
JWindow
(它尚未装饰)。 - 传递给这个窗口,窗口关闭后需要加载的“main”类..
- 添加您想要显示的内容。
- 使用
javax.swing.Timer
“等待”给定的时间段。当计时器触发时,关闭窗口并使用“main”类引用加载应用程序的其余部分。
其他...
关于java - 创建启动画面并使其停留几秒钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14698746/