Loading Spalsh Screen before application launching

会有一股神秘感。 提交于 2019-12-03 23:05:41

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.

Andrew Thompson

See the SplashScreen class.

It includes the createGraphics() method that returns a Graphics2D object that can be written to. You would need to draw the progress bar to the graphics object.


Java Web Start also offers splash screen functionality, configured in the launch file. But the graphics object of the JWS splash screen are not available to the app. (so no 'progress bar').

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