JavaFX - Get TableView column by name -
is there way column tableview name?
when need column have index:
tableview.getcolumns().get(i);
but column name:
tableview.getcolumns().get("column name");
it's hard envision situation in couldn't keep references columns, can write method like
private <t> tablecolumn<t, ?> gettablecolumnbyname(tableview<t> tableview, string name) { (tablecolumn<t, ?> col : tableview.getcolumns()) if (col.gettext().equals(name)) return col ; return null ; }
Comments
Post a Comment