here is my code
public EventHandler dblclickDescription = new EventHandler<MouseEvent>(){
@Override
public void handle(MouseEvent event) {
if(event.getButton().equals(MouseButton.PRIMARY)){
if(event.getClickCount() == 2){
printRow(event.getTarget());
}
}
event.consume();
}
};
public void printRow(Object o){
Text text = (Text) o;
System.out.println(row.toString());
}
1) how can I get from the cell that I clicked on the row?
2) Can I attach an event to an entire row instead of each column?
EDIT: 3) I thought I attached this event to TableCell
TableCell cell = TableColumn.DEFAULT_CELL_FACTORY.call(p);
cell.setOnMouseClicked(dblclickDescription);
but when I tested
event.getSource();
event.getTarget();
event.getTarget();
Is there any way to get TableCell from MouseEvent?
source
share