Old question but may help someone. Original source came from: https://bitbucket.org/controlsfx/controlsfx/issues/462/checkcombobox-ignores-prefwidth-maybe-any by Olivier Vanrumbeke
To reach the combobox from CheckComboBox, try this if the skin is not null:
CheckComboBoxSkin skin = (CheckComboBoxSkin)checkComboBox.getSkin();
ComboBox combo = (ComboBox)skin.getChildren().get(0);
combo.showingProperty().addListener((obs, hidden, showing) -> {
if(hidden) performTaskWhenPopUpCloses();});
And if it's not set yet (skin is null), try this (ugly workaround):
private final ChangeListener<Skin> skinListener = (skinObs, oldVal, newVal) -> {
if (oldVal == null && newVal != null) {
CheckComboBoxSkin skin = (CheckComboBoxSkin) newVal;
ComboBox combo = (ComboBox) skin.getChildren().get(0);
combo.showingProperty().addListener((obs, hidden, showing) -> {
if(hidden)
performTaskWhenPopUpCloses();
});
}
};
checkComboBox.skinProperty().addListener(skinListener);
(version 8.40.9)