1

I have an fxml file that references a css file. When I load this fxml and set it as the root of my scene, the css is applied nicely.

However when I create a custom Region (with getChildren made public), and add the loaded fxml node to it, no css is applied anymore.

The css only uses style classes.

What am I missing here?

/edit

I worked around it by using the approach described here: http://www.guigarage.com/2012/11/custom-ui-controls-with-javafx-part-1

It doesn't answer my initial problem but I guess it's a better way of working anyway.

If someone can still explain the behavior of my original question, I'd be happy to hear it.

Zubzub
  • 782
  • 7
  • 18

1 Answers1

0

The problem was that I used the static load(...) method instead of the instance load method from the created FXMLLoader object.

Zubzub
  • 782
  • 7
  • 18