I’d like to be able to display a node with a particular label centred on the node – eg. a circle or rectangle node for instance with the label in the centre. This seems like it should be trivial and I’m sure it is but the relatively sparse documentation / tutorials on the web mean I can’t seem to find the answer!
At the moment I can display a label on a node no problem (by default it appears so the top left of the label starts in the centre which isn’t what I want) or set a label to appear to the right of the node (by setting a label “for” a particular node) but not position it in the middle! Can anyone shed some light on this one?
I’m betting your looking for something other then a layout, but the StackPane provides this type of functionality.
From the tutorial: Working with Layouts
Code from the tutorial
Example 1-4 Create a Stack Pane