There is a class Street , with a description of an object of the type "street", which contains itself a private String name; , private int id; , private String tymeName and private int typeId , as well as public methods for getting the values of these variables.
There is also a @FXML ComboBox<Street> streetList;
Task: you need to display a list of streets by taking names from the variable name using the getName method. and when selecting a specific street, start event handling via new ChangeListener<Street>() {...} .
Tried to do by analogy with TableView and TableColumn through .setCellFactory and collections.
Question: How to do it so that the name attribute is taken from the object to the list via getName and triggered a new ChangeListener<Street>() {...} passing the selected object for further work.
The spear method, in this case, does not help. How to realize the goal through the lines is clear. But what happens if, for example, Lenin and Lenin are on the list? And the first option is the avenue, the second is the street, but this should not be indicated in the drop-down list. Again, you can come up with a crawl through the strings, but, as it seems to me, it is possible to solve it by passing objects, and not just strings. In the tables, this method works.