I suggest adding a simple example to the javadoc of ComboBox which shows the use of the button cell property. Yes, this may be trivial, but it did not dawn upon me, that I was not supposed to use the CellFactory to do this.
Something like the following would have been helpful to me (feel free to copy paste this directly, if you agree):
"The cell factory does not control how the combo box button area looks. Rather, to control the rendering of the button area, you assign a ListCell value to the buttonCell property. In the following example a custom list cell class called PlaceCell is used to render both the item list and the button of the combo box:
placeComboBox.setCellFactory(new Callback<ListView<Place>, ListCell<Place>>() {
@Override
public ListCell<Place> call(ListView<Place> listView) {
return new PlaceCell();
}
});
placeComboBox.setButtonCell(new PlaceCell());
"
Something like the following would have been helpful to me (feel free to copy paste this directly, if you agree):
"The cell factory does not control how the combo box button area looks. Rather, to control the rendering of the button area, you assign a ListCell value to the buttonCell property. In the following example a custom list cell class called PlaceCell is used to render both the item list and the button of the combo box:
placeComboBox.setCellFactory(new Callback<ListView<Place>, ListCell<Place>>() {
@Override
public ListCell<Place> call(ListView<Place> listView) {
return new PlaceCell();
}
});
placeComboBox.setButtonCell(new PlaceCell());
"