Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can CSS in Javafx be used for animations?

Tags:

java

css

javafx

Here is the link to the animations in CSS https://daneden.github.io/animate.css/

Can you use these in Javafx?

like image 806
Kyle Wolff Avatar asked Jul 06 '15 18:07

Kyle Wolff


1 Answers

Yes, in embedded HTML with CSS

JavaFX has a WebView control which handles CSS animations according to the w3c css animation specification.

No, in the scene graph (with CSS)

The JavaFX 8 scene graph does not support animations with the CSS language itself (as in this w3c css animation specification).

Yes, in the scene graph (with code)

The following information you probably already know and, so, is likely not the answer you are looking for.

The animation sample you link in your question (bounces, fades, etc.) can be handled in code rather than CSS. FXExperience provide a canned animation sample library on how to accomplish such things. Or you can read up on coding animations in the Java tutorials.

You can animate CSS properties from code, see:

  • How to make an animation with CSS in JavaFX?
like image 93
jewelsea Avatar answered Sep 30 '22 03:09

jewelsea