Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
179 views
in Technique[技术] by (71.8m points)

java - Can CSS in Javafx be used for animations?

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

Can you use these in Javafx?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...