I have a button and I just set a graphic on it - in this case an image view - although any node has the same problem. There is a big gap to the left and right of the graphic. It is probably simple but I can't see the css or and methods on the button to remove this gap.
If you look at this zoomed in image here, you can see that I have set a border on the graphic and a border on the button - you can see there is a bit gap between them.
How do I get it so the button just fills the graphic?
If you use css to set the image (via -fx-background-image), you can use -fx-background-size to make the image fill the space. Calling setGraphic on a button is not the same as setting the background image.