View SplashScreen with progress while JFrame loads

2

I have an application done in

asked by anonymous 01.03.2016 / 16:07

1 answer

0

As I have not found a way to properly sync the progress bar according to the load of my JFrame within (EDT), I ended up loading SplashScreen in a Thread parallel to the EDT. I did some tests to get the average time the application took to load and I adapted that time in the progress bar of SplashScreen and the rest I based on the documentation:

  

The splash screen is closed automatically as soon as the first   window is displayed by Swing / AWT (may also be closed manually using   the Java API, see below).

That is, as soon as JFrame is rendered and visible, java itself closes SplashScreen and then ends its Thread.

It was not the best solution, as JFrame may appear even if the bar is not complete, but it answered promptly to my problem.

The question code has not changed.

    
09.03.2016 / 11:27