JavaFX TextArea scrollbar shows on resize even if not needed
I have a TextArea anchored to the vertex, left and right of the AnchorPane. Whenever the window is resized smaller (which changes the size of the AnchorPane and TextArea), scrollbars will appear on the TextArea, even though the text isn't even close to filling the entire area.
The behavior is inconsistent, sometimes it shows as scrollbars, sometimes just horizontal and sometimes nothing. You can make the scrollbars smaller by making the window larger.
Here is the FXML for the TextArea:
<TextArea fx:id="teamDescription" layoutX="10.0" layoutY="107.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#handleTextAreaKeyPress" prefHeight="42.0" prefWidth="380.0">
<VBox.margin>
<Insets bottom="10.0" />
</VBox.margin>
</TextArea>
Is this a problem with JavaFX? Because I can't think of anything that I could have done wrong.
+3
source to share