Java Swing: JWindow appears behind all other process windows, and will not disappear

∥☆過路亽.° 提交于 2019-12-06 06:09:30
Jeffrey

You might want to take a look at java.awt.SplashScreen. However, if your heart is set on your solution:

Looking at Window#toFront,

If this Window is visible, brings this Window to the front and may make it the focused Window.

Try making your JWindow visible before bringing it to the front.

I'm not sure why your JWindow isn't hiding, that part works for me.

/e1
If you're trying to implement a singleton pattern, you should make your constructor and field private. You might also want to take a look at What is an efficient way to implement a singleton pattern in Java?.

/e2
The returns at the end of your showSplash and hideSplash methods are unnecessary, the method would have returned at that point anyways.

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