I have an application done in
I have an application done in
As I have not found a way to properly sync the progress bar according to the load of my JFrame
within event-dispatch-thread (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.