I have a TableView in JavaFx and would like that the rows grow not from the top to the bottom, but from the bottom to the top. Like this:
Is this possible or should I search for a compoletely other method in making this? Thanks for help!
you can just use setRotate(180) on your table. Then you have to use setRotate(180) on your rows. Finally you have to use setRotate(180) on your headers.
Example:
table.setRowFactory(param -> {
final TableRow row = new TableRow();
row.setRotate(180);
return row;
});
prestazioniTable.setRotate(180);
Platform.runLater(()-> {
for (Node n: prestazioniTable.lookupAll(".column-header > .label")) {
if (n instanceof Label) {
n.setRotate(180);
}
}
});
For this you'll likely have to look at TableRows and their factories.
For example the following code:
tableview.rowFactoryProperty().set(table->{
TableRow tr = new TableRow();
tr.prefHeightProperty().bind(Bindings.when(tr.indexProperty().lessThan(1)).then(100).otherwise(30));
return tr;
});
will cause the 1st row(row 0) to have a pref height of 100 and all others 30.
There are some great codes and ideas in the answers to a fairly similar question concerning tablerows: