Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+6 votes
asked in CSC305 Fall 2020 by (8 points)

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 (8 points)
+2 votes

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

answered by (8 points)
+2 votes

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

answered by (8 points)
...