I don't use JavaFX, so all I have is a few questions, and a rough idea.
First:
What OS version?
What Java version?
Second:
Is this on a Mac with a retina-type display?
In your screenshot, I measured a Mac window content area of about 600 x 500 pixels. The code in the example has this line:
Code:
primaryStage.setScene(new Scene(root, 300, 250));
Notice the args 300 and 250 are exactly twice the apparent content area size. To me, this suggests retina-type display handling, where there are 2 linear pixels on the display for each linear point (typographic point, not Cartesian).
The problem seems to be that the placement (and possibly the scaling) of the content within the Scene is incorrect. It looks off by roughly a factor of 2. This is a rough guess, obtained by estimating the center of the button being at the lower-right corner of the displayed content area.
After a little googling, it seems that "HiDPI" is the term used by JavaFX. Here's the search terms I used, and some results:
mac javafx hi dpi
http://stackoverflow.com/questions/26182460/javafx-8-hidpi-support
http://apple.stackexchange.com/questions/53741/java-and-mac-retina-support
To me, this looks like a graphics scaling bug. Unfortunately, it could be in any of several places.
It might be in the version of Java you're using. It might be in the OS version you're using. It might be the particular combination of Java and OS versions, i.e. the bug might only appear when both versions are what you have, and not appear on different combinations of OS and Java.
Some things I'd try in this situation:
Try some of the other JavaFX examples and see if they misbehave the same way.
Try a different version of Java on your current OS version.
Try a different OS version on this version of Java.
Look into how JavaFX does graphical scaling (zoom) and/or Hi-DPU, and see if you can add code to the example that alters it. For example, change the scaling in the Scene to 50% and see what happens. Or force Hi-DPI to be enabled.
Check the Java or JavaFX bug database for reported bugs with default scaling on Mac OS.
Finally, I suppose I should ask-- does JavaFX have a future?
Hard to be certain.
I noticed the link you provided has a last-modified data of Sep 2013. Things might be different now that JavaFX is an integrated part of the Java 8 download.
It may even be that older examples won't work right. It could be worthwhile to try finding newer examples, such as ones that specifically target Java 8.