checkbox - Pre-select a JavaFX CheckComboBox -


all solutions i've read relate combobox, not checkcombobox. using controlsfx checkcombobox i've been able add few options using controller code below. can't figure out how pre-check option @ time added arraylist, nor set prompt text.

...   @fxml      public checkcombobox<string> extras;      @override     public void initialize(url location, resourcebundle resources) {          extras.getitems().add("a");         extras.getitems().add("b"); ... 

there doesn't seem method like: extras.getitems().add("a", true); or extras.getitems().get(0).setvalue(true);

the answer found here uses below, won't work checkcombobox:

extras.setvalue(value); , extras.setprompttext("prompt text");

which leaves me asking:

  1. how set option checked/unchecked during initialization?
  2. how set prompt text on checkcombobox?

i hope code you..

checkcombobox.getcheckmodel().check(0); 

Comments