java - how to get selected row and column number after setgraphic of textbox in tableview in javafx? -
i have set textfield
in column below in tableview
setgraphic(textfield); have added changelistener
updated text, want row , column number.
setgraphic(textfield); textfield.textproperty().addlistener(new changelistener<string>() { public void changed(final observablevalue<? extends string> observablevalue, final string oldvalue,final string newvalue) { system.out.println("old "+oldvalue+" , new : "+newvalue); // here,how can particuler row number } });
assuming selecting 1 tableview
cell, , want column , row index.
get tableview
tablecell:
tableview table = this.gettableview();
then, tableposition first selectionmodel:
tableposition firstcell = table.getselectionmodel().getselectedcells().get(0);
finally, column , row index :
firstcell.getcolumn() //int firstcell.getrow() //int
Comments
Post a Comment