문제

I have a problem with setting SortKeys in java. I used a SortKey from an existing JTable and set it to another one, but somehow it is not working when there are duplicate values in a column, for example the values 1, 2, 3, 4, 5 are sorted correctly, but the values 1, 1, 1, 2, 2, 2, 3, 3 differ in the their order in the JTable.

PS: I already have setMaxSortKeys(int max) on 1.

도움이 되었습니까?

해결책

It is possible that initial ordering of the rows is different in two tables. It is also possible that the sorting algorithm used to sort the tables is not stable. In these cases you can't expect the order to be same for duplicate column values.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top