following problem: I have got a textfield, where the user can input a name for instance. After hitting the enter key, the textfield hides and a label including that text shows. The problem: I need immediately after doing this the new widthProperty of the label, but it always returns 0. Im guessing, the node just has not been drawn yet. Is there any possibility to force a node to get drawn or any other solution for that? Thanks a lot!
String userInput = textField.getText();
textField.setManaged(false);
textField.setVisible(false);
label.setManaged(true);
label.setVisible(true);
label.setText(userInput);
double newWidth = label.widthProperty().doubleValue(); //This is 0!