JavaFX Transitions : An Oddity

I’ve been working on a nice looking application in JavaFX with some nifty transitions.  Doing so, I noticed an odd ‘requirement’ when working with Transitions. The problem arose when I tried to split my interface into different files. On one stage, I used two Stacks that each represented a state. Each Stack was defined in its own JavaFX script and another Script contained the transitions and event handlers.

What happened was that not all Transitions seemed to work. I have not yet been able to determine the root cause of it, but the Transition seemed unable to update properties of its target node. After some frustrated trial and error, I discovered a working solution: put the Transitions in the same file as their target node.

Again, I have not yet found the root cause. If someone can tell me why this is a problem, please let me know. I can’t stand not understanding 🙂

–JH

Posted in JavaFX and tagged .