问题
I´m using the CheckComboBox by ControlsFX for a Project and I want to set some of the Items Checked from the Start so I tried this Code in my initialize-Methode, but when i start the program, nothing is set Selected/Checked.
checkBox.getCheckedModel.check(1);
I´m using an ObservableList of Strings for the Box and got it build into my FXML file and everything works fine, but the CheckModel-thing refuses to work.
Thanks in advance!
回答1:
Hi you can try use the folllowing
CheckComboBox.getCheckModel().checkIndices(int...args);
CheckComboBox.getCheckModel().check(int);
CheckComboBox.getCheckModel().check(String);
These work for me
来源:https://stackoverflow.com/questions/27890237/set-items-selected-in-a-checkcombobox