The MAX_VALUE solution is a bit hacky and could cause performance issues. Also, the answer to this could depend on what your parent container is. Anyway, a better way to do it would be like this:
textArea.prefWidthProperty().bind(<parentControl>.prefWidthProperty());
textArea.prefHeightProperty().bind(<parentConrol>.prefHeightProperty());
You may also want to bind the preferred properties to the actual properties, especially if the parent is using it s computed dimensions rather than explicit ones:
textArea.prefWidthProperty().bind(<parentControl>.widthProperty());
textArea.prefHeightProperty().bind(<parentConrol>.heightProperty());
It s also possible to do this without using binding by overriding the layoutChildren() method of the parent container and calling
textArea.resize(getWidth(), getHeight());
Don t forget to call super.layoutChildren()...