I made Button
with max width of 300 and input a long text in it. Button
got max size, but FlowPane
, which also has max size of 300, grew in width. How comes that Button
text is affecting FlowPane
width? How to prevent it from happening?
Screenshot:
FlowPane
is marked with yellow border.
Button
settings:
FlowPane
settings:
Place the
FlowPane
inside anAnchorPane
. Set theAnchorPane
sizes to theFlowPane
sizes. At the very least, set the left and rightAnchorPane
constraints of theFlowPane
to 0.