Kevin,

What if the splash screen was drawn in the start() method and then the 
rest of the start up code (including the FXML Loader stuff) was run from 
Platform.runLater()?

Would that runLater() code always run after the splash image was finished 
being rendered?

How does the code in runLater() get scheduled?


Neil




From:   Kevin Rushforth <kevin.rushfo...@oracle.com>
To:     Mike Hearn <m...@plan99.net>, 
Cc:     "openjfx-dev@openjdk.java.net" <openjfx-dev@openjdk.java.net>
Date:   05/20/2014 02:56 PM
Subject:        Re: How to force pixels to hit the screen?
Sent by:        "openjfx-dev" <openjfx-dev-boun...@openjdk.java.net>



I see.

> Is there any way to wait for the rendering thread to settle and 
> process the commands produced by the app thread?

No guaranteed way that I know of; we run into a similar issue with our 
robot-based unit tests. Using an AnimationTimer and waiting for a few 
frames might work, but it sounds like you tried that?

-- Kevin


Using the Preloader

Mike Hearn wrote:
>
>     As long as you are doing any of the "heavy lifting" on the FX
>     application thread it will necessarily starve the rendering, since
>     the application thread is where animation is run and rendering is
>     triggered. Applications are encouraged to do computationally
>     expensive tasks or tasks that are subject to blocking (e.g.,
>     network reads) on a different thread.
>
>
> Yes, unfortunately one of the heavy tasks is FXMLLoader.load which 
> hits the threading issues I emailed about earlier.
>
> But I'm not sure I really understand this. I'm OK with my (non 
> interactive) splash being hung whilst the app thread goes off and do 
> other things, as long as it was able to draw at least one frame to the 
> screen. Is there any way to wait for the rendering thread to settle 
> and process the commands produced by the app thread? 



 
NOTICE from Ab Initio: This email (including any attachments) may contain 
information that is subject to confidentiality obligations or is legally 
privileged, and sender does not waive confidentiality or privilege. If 
received in error, please notify the sender, delete this email, and make 
no further use, disclosure, or distribution. 

Reply via email to