In addition to what others have already mentioned, if you could put the ur button (or any other node) in the stack area, you could use the Stackpane alignment property, which accepts javafx.geometry.Pos β the alignment of the child within the stackpane. For example, in your case:
<StackPane > <Button translateY="-15" translateX="15" StackPane.alignment="TOP_RIGHT"/> </StackPane>
source share