for the following sequence (attached):
stage.sizeToScene();
System.out.println(String.format("before: %.0fx%.0f", stage.getWidth(), stage.getHeight()));
stage.show();
System.out.println(String.format("after: %.0fx%.0f", stage.getWidth(), stage.getHeight()));
I get the following output:
before: NaNxNaN
after: 216x238
I need to know stage size before I actually show it to position it correctly. Although it can be achieved by listening to width and height properties, this seems to be overkill for such a simple task.