質問

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