2

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!

4

1 回答 1

4

您好,您可以尝试使用以下方法

CheckComboBox.getCheckModel().checkIndices(int...args);
CheckComboBox.getCheckModel().check(int);
CheckComboBox.getCheckModel().check(String);

这些对我有用

于 2015-06-26T16:52:12.240 回答