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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -