I did the same as you, but with Maps.
I got it to work by nesting SequentialTransition
s.
I did something similar to this:
private SequentialTransition slideshow = new SequentialTransition();
for(int i = 0; i < citiesText.length; i++){
SequentialTransition seq = new SequentialTransition();
FadeTransition fade = new FadeTransition(Duration.millis(2000), citiesText[i]);
fade.setFromValue(1);
fade.setToValue(0);
PauseTransition stop = new PauseTransition(Duration.millis(3000));
seq.getChildren().addAll(fade, stop);
slideshow.getChildren().add(seq);
}
slideshow.play();
As you can see, I invested th SequentialTransition
, so that each citiesText
has its own, but they play in order because of the externalSequentialTransition
source
share