1

我在如何在JFXTRAS 2的议程组件中获取选定的约会时遇到问题,关于如何在议程组件中获取选定的约会有什么想法吗?

4

1 回答 1

1

JFXTRAS 2的议程组件提供了一个selectedAppointments属性。

所以你可以得到选定的约会,

Collection<Appointment> selectedAppointments = agenda.selectedAppointments();

听属性修改,

agenda.selectedAppointments().addListener(new ListChangeListener<Appointment>() {
    @Override
    public void onChanged(Change<? extends Appointment> c) {
    }
});

将该属性绑定到另一个属性,

ObservableList<Appointment> observableList = FXCollections.observableArrayList();
Bindings.bindContent(observableList, agenda.selectedAppointments());

在 a 中显示选定的约会ListView

ListView<Appointment> listView = new ListView<Appointment>(agenda.selectedAppointments());
于 2013-02-25T14:46:31.947 回答