我在另一个类中创建了一个吸气剂,以检索数组列表,但是当我将其分配给listView时,什么都没有显示
public Set<Model.Patient> getSet() {
return set;
}
这是显示JavaFX的第二个类
PractitionerUIView ui = new PractitionerUIView();
ListView<Patient> listView = new ListView<>();
public ListView<Patient> getLeftLabel() {
ObservableList<Patient> names = FXCollections.observableArrayList(ui.getSet());
listView = new ListView();
listView.setPrefWidth(150);
listView.prefHeightProperty().bind(root.heightProperty().subtract(2*SIZE));
listView.setStyle("-fx-border-style: dotted; -fx-border-width: 0 1 0 0;"
+ "-fx-border-color: gray; -fx-font-weight: bold");
listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
listView.setItems(names);
return listView;
}
我希望看到患者姓名列表