Using ScaleTransition

The scale can be changed by the vertical and horizontal dimension separately as shown in the following code snippet:

ScaleTransition st = new ScaleTransition(Duration.seconds(3), node);st.setToX(2); // double the size of the nodest.play();

While using the byX/byY methods, keep in mind that you are starting from a scale equal to 1 in both dimensions, for example:

st.setByX(1); // double the size of the nodest.setByX(-1); // change size to 0

Get Mastering JavaFX 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.