B4J Question fx scene builder stylesheets

Similar threads

B4J Tutorial Working with JavaFX Scene Builder
B4J Tutorial Raspberry Pi with Java 11
B4J Code Snippet Dark theme - base color
B4J Question Error css
B4J Library [class] CSS Utils

tremara1

Active Member
Licensed User
Just a quick newbie question, can you use stylesheets on components. I tried with a button the preview in scene builder looked ok but when I ran the app with b4j I got an error:

com.sun.javafx.fxml.PropertyNotFoundException: Property "stylesheets" does not exist or is read-only.

If I add the style elements manually in scene builder it works.

I probably should know this.....thanks
 

tremara1

Active Member
Licensed User
Thanks, I still had no luck so as I was using Scene builder v2.0 I tried v1.1 and recreated the same project from scratch and it worked. I then had a look at the fxml file(s) and they were different. The stylesheet tag was different. I have zipped the 2 fxml files if you want to look at them.. The 'test.fxml' was v1.1 and 'test2.fxml' was with v2.0
 

tremara1

Active Member
Licensed User
Thanks, I still had no luck so as I was using Scene builder v2.0 I tried v1.1 and recreated the same project from scratch and it worked. I then had a look at the fxml file(s) and they were different. The stylesheet tag was different. I have zipped the 2 fxml files if you want to look at them.. The 'test.fxml' was v1.1 and 'test2.fxml' was with v2.0
I have used Scene builder v2.0 for a couple of projects with no issues seems my only issue is when I try to use external css with v2.0
 

tremara1

Active Member
Licensed User
Please upload the complete project (File - Export as zip).
This is the project is just a test to work with css....the fxml file test.fxml was created with scene builder v2.0 it is the one not working. I created the same file in v1.1 which is called testy.fxml it does work if you rename it to test.fxml all works fine.
 

Attachments

tremara1

Active Member
Licensed User
Thanks, that was my problem I was still configured to Java 7.
 
Top