When the table selection is in row mode, we don't get the clicked/selected/focused cell.
e.g. right click with mouse opens a detail popup which needs the cell for data display...
Example with mouse clicked event:
table.setOnMouseClicked(new EventHandler<MouseEvent>()
{
@Override
public void handle(MouseEvent event)
{
System.out.println("Clicked: " + ((TablePosition)table.getSelectionModel().getSelectedCells().get(0)).getColumn());
System.out.println("Clicked-2: " + table.getFocusModel().getFocusedCell().getColumn());
table.edit(0, 0);
}
});
The cell is always -1.
e.g. right click with mouse opens a detail popup which needs the cell for data display...
Example with mouse clicked event:
table.setOnMouseClicked(new EventHandler<MouseEvent>()
{
@Override
public void handle(MouseEvent event)
{
System.out.println("Clicked: " + ((TablePosition)table.getSelectionModel().getSelectedCells().get(0)).getColumn());
System.out.println("Clicked-2: " + table.getFocusModel().getFocusedCell().getColumn());
table.edit(0, 0);
}
});
The cell is always -1.