I need to save column width in user-settings file that i cloud load the TableView with the same width of each column that user previously given for better user experience.
In my research there is a listener on change in width property
tcName.widthProperty().addListener(new ChangeListener<Number>() {});
Where "tcName" is column object.
this is firing several times in a raw while changing the column width.
is there any event called changed ? Or
any possiblility to get output like below
@FXML
private TableView<ItemEmployee> tvData;
@FXML
private TableColumn<ItemEmployee, String> tcCode;
@FXML
private TableColumn<ItemEmployee, String> tcName;
@FXML
private TableColumn<ItemEmployee, String> tcCompany;
tcCode.setCellValueFactory(new PropertyValueFactory<>("Code"));
tcName.setCellValueFactory(new PropertyValueFactory<>("FullName"));
tcCompany.setCellValueFactory(new PropertyValueFactory<>("CompanyName"));
tvData.columnWidthChanged(){
system.out.println("width changed column name: tcCode/Code " );
system.out.println("width of column tcCode/Code : 150" );
saveColumnWidth("tcCode/Code",150);
};