Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+7 votes
asked in CSC305 Fall 2020 by (1 point)

3 Answers

+2 votes

There are several getBounds() methods in javaFX to find the location of a node. I found that the best option is to use getBoundsInParent().getX() to get the x and also same but getY() to get Y. Bounds also returns some other information that you may find useful

answered by (1 point)
+2 votes

You can also use getLayoutY() and getLayoutX() methods to get the x and y coordinates.

answered by (1 point)
+2 votes

getBoundsInParent method is what my group uses for this and it works well.

answered by (1 point)
...