I've searched extensively for this, but failing to arrive at a proper solution, I had to proceed with this question.
I have just recently started learning JavaFX/Java and I am trying to build a table which, along with some other columns, would have a single ProgressIndicator column. This means that a ProgressIndicator needs to be displayed within a table cell.
Work I've done so far: http://pastebin.com/raw.php?i=QxSmsJCT
@Override // This method is called by the FXMLLoader when initialization is complete
public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
fileName.setCellValueFactory(new PropertyValueFactory<Table, String>("fileName"));
transferSpeed.setCellValueFactory(new PropertyValueFactory<Table, Double>("transferSpeed"));
piColumn.setCellValueFactory(new PropertyValueFactory<Table, Double>("piColumn"));
ProgressIndicatorTableCell pitc = new ProgressIndicatorTableCell();
piColumn.setCellFactory(pitc.<TableCell>forTableColumn());
transferTable.setItems(data);
}
class ProgressIndicatorTableCell<S> extends TableCell<S, Double> {
public <S> Callback<TableColumn<S, Double>, TableCell<S, Double>> forTableColumn() {
return new Callback<TableColumn<S, Double>, TableCell<S, Double>>() {
@Override
public TableCell<S, Double> call(TableColumn<S, Double> param) {
return new ProgressIndicatorTableCell<>();
}
};
}
}
While the other columns work perfectly (and display the data I feed them), I'm not able to figure out why the ProgressIndicator doesn't show up at all.
If the errors and mistakes within my code's logic and/or project hierarchy setup could also be highlighted, it would be extremely appreciated.
Thanks.