1

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!

nibarius
  • 4,007
  • 2
  • 38
  • 56
Wasabi21
  • 11
  • 1

2 Answers2

1

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);
            }
        }
    });
    
Francesco
  • 11
  • 3
0

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:

Programmatically change the TableView row appearance

Community
  • 1
  • 1
el_chupacabra
  • 169
  • 1
  • 2
  • 9
  • I don't see how it solves the problem - the rows will still be displayed in their order from top to bottom. Is there such a property that controls the location of the row? – Itai Feb 24 '16 at 09:16