in my company we got a task to implement an autoexpandable textfield. As this functionality is not provided by default we had to develop it from scratch. There are many posibil
you can set PrefWidth in the listener of the text field.
// add listner
'textField.textProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue extends String> observable, String oldValue, String newValue) {
textField.setPrefWidth(textField.getText().length());
}
});'