torsdag 8. november 2012

JavaFX - FXML ... "Root value already specified."

"Curiosity killed the cat you know". Tim Burtons fantastic movie Nightmare Before Christmas, and this quote from Doctor Finklestein comes to mind. The movie is about Jack Skellington, the Pumpkin King of Halloween Town, who discovers Christmas. And what a mess that becomes, since he doesn't quite understand what Christmas is.

Trying to be clever usually gives me a lot of hassle, so I guess I can relate to this Jack Skellington character.

Here I am, trying to create a nifty JavaFX CSS Demo. But why choose the easy path? "I should try do this with FXML which I haven't looked at yet". It had to go wrong right?

Have you tried Google this?
Caused by: javafx.fxml.LoadException: Root value already specified.

I guess I might be the first to try explain this on the entire internett ... *sigh*

JavaFX - CSS tips


There is a few blogs and tutorials about how to CSS style your magnificent JavaFX application already, so there is no point for me to duplicate that. I have made an small example where I have explored styling a bit.


This is of course a simple example, so I was thinking of sharing a few tips, tricks, a bit of code and some ramblings on the matter.