ControlsFX’s CheckComboBox | How to use CheckComboBox in JavaFX?

In this blog you will learn how to use ControlsFX api based CheckComboBox. It is very useful control, here we have items with checkbox in ComboBox. I have explained the use of CheckComboBox and implementation step by step.Prerequisite: 1) Need to download controlsfx.jar from below link :

Please check the code given below. It’s easy to implement.
 // create the data to
show in the CheckComboBox
 final
ObservableList<String> strings = FXCollections.observableArrayList();
 for (int i = 0; i
<= 100; i++) {
     strings.add(“Item
” + i);
 }
 // add listener to
listen the relevant events (e.g. when the selected indices or
 selected items
change).
checkComboBox.getCheckModel().getCheckedItems().addListener(new
ListChangeListener<String>()
{
     public void onChanged(ListChangeListener.Change<?
extends String> c) {

System.out.println(checkComboBox.getCheckModel().getSelectedItems());
     }
 });
 }
For detailed understanding please watch my video tutorial with a complete explanation step by step.

Leave a Comment