3 Replies Latest reply on Nov 19, 2012 9:33 PM by David Grieve-Oracle

    Setting node properties by CSS?

      Is it possible to set any node property by CSS? Can I introduce my own property and than set in my CSS file?
        • 1. Re: Setting node properties by CSS?
          I think that setting node properties is what fxml and java code is for, not css.
          • 2. Re: Setting node properties by CSS?
            Yes but there are some cases where it would be better to set a property in pure CSS. Please think of a CheckBox which is skinned for different target platforms. A checkbox on Desktop windows contains of a rectangle and a mark. But the Checkbox (Toggle button) on iOS (iPhone, iPad) has a label "ON" / "OFF" in the background of the checkbox. So it would be good to set the text property of a node (e.g.)

            Because JavaFX CSS does not support setting any node property I have to include the "ON"/"OFF" as background image...the point is: It's not scalable (no SVG).

            • 3. Re: Setting node properties by CSS?
              David Grieve-Oracle
              See http://docs.oracle.com/javafx/2/api/index.html for a list of properties that can be set via css.