thank you for reading my question.
I'm working with a TreeTableView, and managed to display a Boolean value into one of the columns, by following the results proposed on this answer. It works perfectly, but when applied, the checkbox has a TOP_LEFT alignment, instead of the CENTER one (the CENTER alignment is the default for using checkboxes on regular TableView):
^ This is the TOP_LEFT alignment I'm having
I searched, but the regular solution for changing the alignment to the content of a cell is not working here, producing no results at all.
Is there any way to change the alignment to CENTER or TOP_CENTER? I'm using Java8.
EDIT WITH MORE INFO The GUI is made in FXML, with the TreeTableView inside a TitledPane. Using this solution to center text cells (same table, other columns) works fine. Removing this from the other columns does not affect the Checkbox column
I tried adding the Checkbox in two different manners, but both of them have the TOP_LEFT alignment:
colUsable.setCellFactory(CheckBoxTreeTableCell.forTreeTableColumn(colUsable));
And the other attempt:
colUsable.setCellFactory(new Callback<TreeTableColumn<MyType,Boolean>,TreeTableCell<MyType,Boolean>>() {
@Override
public TreeTableCell<MyType,Boolean> call( TreeTableColumn<MyType,Boolean> p ) {
return new CheckBoxTreeTableCell<>();
}
});
Thank you so much.