×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
0
Language: Java
Posted by: Richard McDonald
Added: May 10, 2014 7:51 AM
Modified: May 10, 2014 7:56 AM
Views: 273
Tags: javafx
Force a TreeItem to update in the TreeView, when its value has been externally modified. This is a kludge fix for situations where the TreeItem's valueProperty is unchanged, but the value's contents have been modified.
  1. TreeItem ti = treeView.getSelectionModel().getSelectedItem();
  2. Object object = ti.getValue();
  3. // force reference change
  4. ti.setValue(null);
  5. ti.setValue(object);
  6.