How can an individual column width be forced in a TableView?
Let's say I have a button to reset the width of all my columns to a pre-defined value. My TableView is configured to have UNCONSTRAINED_RESIZE_POLICY
. Right now, if I resize two columns manually and then hit the reset button, nothing happens.
I'm using setPrefWidth()
to set the preferred column width. I even checked the value before and after, it changes as desired. The visual representation, however, stays the same. Is there any possibility to force a real column resize to the desired width? Can I tell my table to re-layout, update or be re-drawn?
Does JavaFX provide a function such as pack()
in SWT to force a component to resize to its preferred width/height?
Try to bind the columns width to that of the table: