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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -