If a row is selected in the table view, sorting by any column changes the selection; the selected index usually remains the same so whatever object is at that index based on the new sort order becomes the selected object.
Is it a bug or a feature? If it is a feature is there an easy way to maintain the existing selection after the sort?
With the TableViewSample inJavaFX examples I have seen that if I keep on sorting for a few times with different columns, even the index changes in some cases, that is definitely a bug.