我必须编写方法,它将获取我的字符串(显示以逗号分隔的小时),并返回字符串的ListProperty。 在我的构造函数中我有逗号分隔的字符串为ListProperty
this.showingHour = new SimpleListProperty<String>();
我想用的方法从这个话题:https://stackoverflow.com/a/7488676/4750111
List<String> items = Arrays.asList(str.split("\\s*,\\s*"));
但它会创建的ArrayList。有没有像这样的功能,但对于ListProperty?
谢谢,我不得不改变声明为'this.showingHour = new SimpleListProperty(FXCollections.observableList(new ArrayList ()));'然后做分割 –
Paus