Reputation: 621
In JavaFX I'm switching from one stage to another with stage1.hide(); stage2.show();
However, stage2 is quite big and contains a whole bunch of elements. So when I show() it, when it pops up for the first time, there is a 400-millisecond period of time where the whole stage is empty and grey. Then all the elements appear.
It's horribly ugly. This is on an i7 with a really good GPU.
I have noticed that if I show it, then hide it, then show it again, the final show will look perfect from the moment it appears on screen. However there is a flashing when I hide() then show() the stage for the first time, so that won't work.
Is it somehow possible to achieve what I described in the above paragraph without having to have the stage appear on screen beforehand?
This is on Java 8u5 with the new Modena theme. It is worth noting that with JavaFX 2.2 this issue is not present.
Thankyou!
Upvotes: 2
Views: 774
Reputation: 159416
The root cause of this issue was a performance regression introduced in an early Java 8 release. Updating the Java 8 version to the latest development version, fixed the issue (as reported by the original poster).
After the update, the user no longer experienced: "a 400-millisecond period of time where the whole stage is empty and grey". Therefore the original request in the issue "Preload a JavaFX stage before show()", was no longer required as performance was fine without any preloading tweaks.
Upvotes: 4