I have a JTable with some columns. I have a HashMap of a column id mapped to a position in a view, for example:
TableHeader1 | TableHeader2 | TableHeader3 sth. sth. sth.
I know that:
TableHeader1 -> position 0 TableHeader2 -> position 1 TableHeader3 -> position 2
Now I want to reorder the columns. I know that in the JTable class there is a function moveColumn (A, B). This moves the column from A to B, and B moves left or right. My problem is that I want to arrange the whole table in a certain way, how can I do this? If I use moveColumn, I cannot know where B was moved, in 5 out of 10 cases it could be the right side, and in other cases the wrong side.
I hope you understand my problem :-)
source share