I have a tableView of person. every time i pass the mouse over a person row, i want to show some information about it . ( the information can be showed in a textArea for example). Thanx
1 Answers
Can you assign the onMouseEntered property of the TableCell instances in your TableView value?
A custom cell value factory can be used to provide instances of an application-specific cell subclass. This allows the custom cell to assign its own event handling function to the event handling property defined by Node. For example, try this in the custom subclass of TableCell provided by the cell value factory:
onMouseEntered = (event: MouseEvent) => {
info(s"onMouseEntered cell ${index()}: $event")
event.consume()
}
TableCell.index() provides the current index of the cell in the TableView.
If you don't get the value you expect it might be because cells are recycled. If you scroll through a large table the TableView will use a technique called "virtualization" to reuse the cell instances by associating an existing cell with different content, e.g. the first cell that you can see might be the 100th cell in the table.

- 7,499
- 3
- 32
- 50