public class FilterController{
@FXML
public TableView<DataFilter> tableView;
@FXML
public TableColumn<DataFilter, String> columnWord;
@FXML
public TableColumn<DataFilter, Integer> columnFrequency;
@FXML
public void initialize() {
columnWord.setCellValueFactory(new PropertyValueFactory<DataFilter, String>("word"));
columnFrequency.setCellValueFactory(new PropertyValueFactory<DataFilter, Integer>("number"));
tableView.setItems(data());
}
ObservableList<DataFilter> data(){
ObservableList<DataFilter> list = FXCollections.observableArrayList();
list.add(new DataFilter("город", 1));
return list;
}
}
public class FilterController{
@FXML
public TableView<DataFilter> tableView;
@FXML
public TableColumn<DataFilter, String> columnWord;
@FXML
public TableColumn<DataFilter, Integer> columnFrequency;
@FXML
public void initialize() {
columnWord.setCellValueFactory(new PropertyValueFactory<DataFilter, String>("word"));
columnFrequency.setCellValueFactory(new PropertyValueFactory<DataFilter, Integer>("number"));
tableView.setItems(data());
}
ObservableList<DataFilter> data(){
ObservableList<DataFilter> list = FXCollections.observableArrayList();
Filter filter = new Filter();
return filter.observableList();
}
}