How can I get position of TableCell in class implementation so I can do something like this: ?
@Override
public void updateItem(Integer item, boolean empty) {
super.updateItem(item, empty);
int x = thisCellColumnNumber();
int y = thisCellRowNumber();
if((x == 2) && (y == 3))
setStyle(".....");
You can get the actual
TableColumn
withthis.getTableColumn();
. If you really need the index, you could dowhich is a bit ugly (and slow). However, just knowing the column should be enough. (Additionally, you really "know this already"; your table cell comes from a table cell factory, which is attached to a column; so you can always figure the column index and pass it to the cell when you create it.)
The row index is just
See the Javadocs for all available methods.