Is it possible to use the javafx.scene.effect.Reflection in CSS for a FXML file?
And something more general (I haven’t found any answer for that yet): Can I do everthing with FXML and CSS that is available on the Java API (using JavaFX 2.2)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not for JavaFX 2.2 – only dropshadow and innershadow effects can be set via CSS.
Future JavaFX versions will probably add the ability to set more effects via CSS.
For now if you want an effect like that in combination with FXML, then you can use a Controller or define the effect in FXML without using CSS.
For example:
To visually design and define your FXML based effects, use SceneBuilder, click on your Node, go to the Properties Pane and select an effect to customize from the Effect drop down box.
You will still need to write some non-fxml embedded code to launch the app and load up your fxml.
If you use FXML’s scripting feature you could do most of what can be done on the Java API. For ease of maintenance, I would however recommend using an FXML Controller or hosting script code external from your fxml files rather than embedding it in the fxml.