I have just began building a JavaFX application in IntelliJ using the latest Java7 SDK.
I have built my interface using Oracle Scene Builder, everything runs and displays fine on the preview, but when I try and compile my program I get the following error
`Property "stylesheets" does not exist or is read-only`
Judging against JavaFX Documentation the line stylesheets="@MainView.css"
in my FXML does not appear invalid.
Does anybody know why I am getting this error? ( If I remove the link to the stylesheet my program compiles just fine, so the problem lies solely with the stylesheet, I'm stumped! )
You were creating an FXML in Scene Builder 2 and running in JDK 7. SB 2 "tries to" create Java 8 compatible FXML code. To fix the FXML:
stylesheets="@MainView.css"
attribute<?import java.net.*?>
in the importsAdd the below code at the end of parent pane, after </children>
(in my case it was before </AnchorPane>
):
<stylesheets>
<URL value="@MainView.css" />
</stylesheets>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With