JTable Clickable Column Sorting: Sorting sorts content of cells, but doesn't update cell formatting?

前端 未结 2 1518
臣服心动
臣服心动 2020-12-15 19:07

I have a sortable JTable set up to use a custom extension of the AbstractTableModel. However, some behavior of this table is what I expected, and I

相关标签:
2条回答
  • 2020-12-15 19:39

    you have to convert row index from View to the Model

    int modelRow = convertRowIndexToModel(row);
    
    0 讨论(0)
  • 2020-12-15 19:43

    You can enable table sorting by clicking on header using this table.setAutoCreateRowSorter(true);

    for more information visit this site http://www.codejava.net/java-se/swing/6-techniques-for-sorting-jtable-you-should-know

    0 讨论(0)
提交回复
热议问题