Start HelloTreeView.
Select "Child Node 4".
Press "Add child To Child Node 2" button.
Press triangle to open "Child Node 2"
Note that the selection remains on Child Node 4, but focus moves to Child Node 5.
Adding this code at the end of buildSimpleTab method
treeView.getFocusModel().focusedIndexProperty().addListener((observable, oldValue, newValue) -> {
System.out.println("focusedIndex: " + oldValue + " to " + newValue);
});
reveals this log:
SelectedIndex: 4
focusedIndex: -1 to 4
SelectedIndices: [4], removed: [], addedFrom: 0, addedTo: 1
focusedIndex: 4 to 5 // after button press
SelectedIndex: 5 // after triangle press
SelectedIndices: [5], removed: [], addedFrom: 0, addedTo: 1
focusedIndex: 5 to 6
Select "Child Node 4".
Press "Add child To Child Node 2" button.
Press triangle to open "Child Node 2"
Note that the selection remains on Child Node 4, but focus moves to Child Node 5.
Adding this code at the end of buildSimpleTab method
treeView.getFocusModel().focusedIndexProperty().addListener((observable, oldValue, newValue) -> {
System.out.println("focusedIndex: " + oldValue + " to " + newValue);
});
reveals this log:
SelectedIndex: 4
focusedIndex: -1 to 4
SelectedIndices: [4], removed: [], addedFrom: 0, addedTo: 1
focusedIndex: 4 to 5 // after button press
SelectedIndex: 5 // after triangle press
SelectedIndices: [5], removed: [], addedFrom: 0, addedTo: 1
focusedIndex: 5 to 6