JavaFX How to get all values of one column from TableView? -
JavaFX How to get all values of one column from TableView? -
i info of 1 column tableview after button click.
i found code
tableposition pos = table.getselectionmodel().getselectedcells().get(0); int row = pos.getrow(); // item here table view type: item item = table.getitems().get(row); tablecolumn col = pos.gettablecolumn(); // gives value in selected cell: string info = (string) col.getcellobservablevalue(item).getvalue();
but code selected cell , have button , cells of 1 column.
can help me pls? thankyou.
just same thing elements of table.getitems()
:
tablecolumn<mydatatype, string> column = ... ; // column want list<string> columndata = new arraylist<>(); (mydatatype item : table.getitems()) { columndata.add(col.getcellobservablevalue(item).getvalue()); }
where mydatatype
info type of tableview
.
javafx
Comments
Post a Comment