• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sequential tasks

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm really struggling here...
I have 2 stages, stage-MAIN is behind stage-TRANSPARENT initially.
Upon pressing on stage-TRANSPARENT, I would like to do the following:

Steps
------
1. Take snapshot of stage-MAIN, and insert as ImageView into stage-TRANSPARENT
2. Move stage-TRANSPARENT to back of screen with .toBack();
3. Now move stage-MAIN to the back of screen with .toBack();
4. Since stage-TRANSPARENT is now in front again, remove the ImageView from it.

It seems like this should work fine without the desktop wallpaper flickering through, but it does flicker through.
Its like it renders it all in one go, even if I use Thread.sleep(1000) to pause each between the steps shown.
There seems to be 1 long pause, then it does everything, its not doing it sequentially as I need it to.

I'm even using Platform.runLater(), but it has little or no effect.

Can anyone help me figure out a way round this, I would pay a small amount by paypal to the first correct solution that I can get to work, if wanted.

Thanks very much.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!