Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

TableView cell coloring on updates - noticing if sorting happened

meriJul 9 2013 — edited Jul 9 2013

I am trying to make cells highlighted (colored) in a TableView every time they are updated. My solution is based on setting up cell factories and use Animation (Timeline) to control cell background opacity - it is working fine: every time a cell value is updated, the background color changes, then fades away nicely.

The problem is, that if the table is being sorted by clicking on a column header, the underlying item list is changed (of course), and at the GUI level it is also understood as a change, and based on the per-cell circumstances (I flash a cell only if its new value is different than the previous), multiple cells indicate an update unnecessarily (flashing).

I wonder how could I eliminate if a cell has been updated because of a "real" update (an item has been updated) from the case when the list sort column and/or order has been changed? I was thinking of catching the sorting event (by adding an InvalidationListener to the list of the sort orders) and ignore the updates while it is in progress, but I cannot really know when it is finished. I bet at the GUI level there is no way to decide the reason, so I would need a deeper understanding...

Thanks for any hints.

This post has been answered by James_D on Jul 9 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 6 2013
Added on Jul 9 2013
2 comments
1,440 views