在启动应用程序之前加载Spalsh屏幕

在启动应用程序之前加载Spalsh屏幕

本文介绍了在启动应用程序之前加载Spalsh屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在图像中没有标题栏(如Eclipse)的情况下创建加载的jframe ...

How can I do to create a loading jframe without title bar like Eclipse in the image...

我使用setUndecorate()删除标题栏和一个线程等待3秒钟,然后打开主窗口,但是它不起作用...我不打算使用进度条...

I used setUndecorate() to remove the title bar and a thread to wait 3 seconds then open the main window but it wouldn't work ...I'm not thinking to use a progressbar...

我该怎么办?

谢谢.

最好的花园,

阿里

推荐答案

另一种方法可能是您已经想到的:在应用程序启动时显示未经修饰的JFrame,然后不要等待几秒钟(您可以这样做)同样,如果您希望用户阅读一些信息),只需继续初始化应用程序即可.初始化完成后,关闭启动画面"(未装饰的JFrame)并打开实际的应用程序JFrame.

Another way could be what you already thought of: display an undecorated JFrame when the application starts, then instead of just waiting for a few seconds (you could do that as well, if you want users to read some info) just keep initializing the application. When initialization is finished, close the "splash screen" (undecorated JFrame) and open the actual application JFrame.

这将使您能够显示动态信息(如以后要显示进度条,一些文本等).如果您只需要一个静态启动画面,请征询安德鲁的建议并使用内置的启动画面功能.

This would enable you to display dynamic information (like a progress bar if you later want to, some text etc.). If all you need is a static splash screen, go for Andrew's advice and use the built in splash screen functionality.

这篇关于在启动应用程序之前加载Spalsh屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 00:54