In OOP, I learned that we can call a method by using its class.
For example:
Person person = new Person();
person.methodA(); // calling the method in person class
Based on javafx docs of ListView (link) , The getSelectionModel() is a method of a class ListView (okay working). But the selectedItemProperty() method is the class of SelectionModel (link)
How can you call a method selectedItemProperty() without using its SelectionModel class? And what class does this addListener method came from?
myListView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TodoItem>() {
/// blah blah blah
}
});