JavaFX ScrollPane programmatically moving the viewport - centering content
问题 I can use the setVvalue(double) and setHvalue(double) methods to move a viewport in a JavaFX ScrollPane. What I'm struggling to do is center a particular node in the content of the scroll pane based on its position. I've tried all sorts of combos of localToScene() and boundsInParent(). I've read (a lot) and seen this example How to scroll to make a Node within the content of a ScrollPane visible? Which is close but doesn't center the objects just puts them visible. Having the built in mouse