Check out example codes for "on selected item changed listview javafx". It will help you in understanding the concepts better.

Code Example 1

myListView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<MyDataModel>() {

    @Override
    public void changed(ObservableValue<? extends MyDataModel> observable, MyDataModel oldValue, MyDataModel newValue) {
        // Your action here
        System.out.println("Selected item: " + newValue);
    }
});

Learn ReactJs, React Native from akashmittal.com