My application contains a TableView
. Depending on the value of a specific cell in each row, the row style is changed by setting a custom cell factory with setCellFactory
for this column. This works fine.
Now I'd like to add a tooltip which is no big deal using setTooltip()
. However this tooltip shall be set for every cell in the table, not just the column it is specified for. How can I implement this?
Once the table is set up (i.e. the columns are created and added, and the cell factories are set on all the columns), you can "decorate" the columns' cell factories:
Here just replace
TableDataType
with whatever type you used to declare yourTableView
, i.e. this assumes you haveNow, after you have created the columns, added them to the table, and set all their cell factories, you just need:
or if you prefer a "Java 8" way: