Using a Timer in Swing to display a picture for 5 seconds

后端 未结 2 722
小鲜肉
小鲜肉 2021-01-28 23:37

I am trying to make a login picture for my application using Timer. The idea is, when the user opens the application, he will see a picture for 5 seconds, then the

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-29 00:08

    The idea is, when the user opens the application, he will see a picture for 5 seconds, then the application will start.

    You should use a Splash Screen. The advantage of the splash screen is the image is displayed immediately as the whole Swing app doesn't need to be loaded.

    Check out the section from the Swing tutorial on How to Create a Splash Screen for more information and a working example.

提交回复
热议问题