I would like to restore the column width of every column in my TableView after a restart of my javaFX application. Therefore I read an article which discribes how to achive this. Unfortunately the code did not work for me. The columns do not resize after the restart. (But the values for width and prefWidth did change correctly)
Article - How to remember the width of TableColumns
I already did some reading but was not able to solve this problem:
- Force individual column width in TableView
- javafx 2 automatic column width
- TableColumn wont take full size of the TableView in javafx
The resize policy for my table is set to CONSTRAINED_RESIZE_POLICY and this seems to be the problem. If I switch to UNCONSTRAINED_RESIZE_POLICY the columns get resized. But as I want the columns not to disappear when the user changes the columnwidth, I would like to stay with the constrained resize policy.
Any help would be greatly appreciated. Many thanks in advance.