I have created the treeview in javafx2. i need to write the event for getting clicked node name.
pls let me know how to do this?
Slightly more updated version, using lambdas which cleans it up a bit:
treeView.getSelectionModel() .selectedItemProperty() .addListener((observable, oldValue, newValue) -> System.out.println("Selected Text : " + newValue.getValue()));