I am trying to align the exact center of a Text object in JavaFX, and have it sit in the exact center of the JavaFX window. This part works fine. Whenever I add in another Text object that reads 'SETTINGS', I use the same formula, but I change the y-axis by 10 pixels. For some reason, the second text aligns to the right of the other text, while keeping the changed y-axis. Why is this?
This is my formula: (widthOfWindow / 2) - (widthOfTextObject / 2)
This should give me the exact center of the the x-axis, right? I simply change it to fit the y-axis.
EDIT1: This link is a picture of the method I'm using, as well as the product.